1
0
Fork 0

- repository reorganization

git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/trunk@242 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
Jan Dittberner 2008-01-12 22:24:08 +00:00
parent 5c1a97e82d
commit dea15a6c4f
29 changed files with 1053 additions and 0 deletions

View file

@ -0,0 +1,4 @@
This is a database migration repository.
More information at
http://trac.erosson.com/migrate

View file

View file

@ -0,0 +1,4 @@
#!/usr/bin/python
from migrate.versioning.shell import main
main(repository='ormaptest_repo')

View file

@ -0,0 +1,20 @@
[db_settings]
# Used to identify which repository this database is versioned under.
# You can use the name of your project.
repository_id=OR Mapping Test
# The name of the database table used to track the schema version.
# This name shouldn't already be used by your project.
# If this is changed once a database is under version control, you'll need to
# change the table name in each database too.
version_table=migrate_version
# When committing a change script, Migrate will attempt to generate the
# sql for all supported databases; normally, if one of them fails - probably
# because you don't have that database installed - it is ignored and the
# commit continues, perhaps ending successfully.
# Databases in this list MUST compile successfully during a commit, or the
# entire commit will fail. List the databases your application will actually
# be using to ensure your updates to that database work properly.
# This must be a list; example: ['postgres','sqlite']
required_dbs=[]

View file

@ -0,0 +1,14 @@
from sqlalchemy import *
from migrate import *
meta = BoundMetaData(migrate_engine)
account = Table('account', meta,
Column('id', Integer, primary_key=True),
Column('login', String(40)),
Column('passwd', String(40)))
def upgrade():
account.create()
def downgrade():
account.drop()

View file

@ -0,0 +1,11 @@
from sqlalchemy import *
from migrate import *
meta = BoundMetaData(migrate_engine)
account = Table('account', meta)
def upgrade():
account.drop()
def downgrade():
account.create()

View file

@ -0,0 +1,45 @@
from sqlalchemy import *
from migrate import *
meta = BoundMetaData(migrate_engine)
supermasters = Table('supermasters', meta,
Column('ip', String(25), nullable=False),
Column('nameserver', String(255), nullable=False),
Column('account', String(40)),
)
domains = Table('domains', meta,
Column('id', Integer, primary_key=True),
Column('name', String(255), nullable=False),
Column('master', String(20)),
Column('last_check', Integer),
Column('type', String(6), nullable=False),
Column('notified_serial', Integer),
Column('account', String(40)),
UniqueConstraint('name', name='name_index')
)
records = Table('records', meta,
Column('id', Integer, primary_key=True),
Column('domain_id', Integer),
Column('name', String(255)),
Column('type', String(6)),
Column('content', String(255)),
Column('ttl', Integer),
Column('prio', Integer),
Column('change_date', Integer),
ForeignKeyConstraint(['domain_id'], ['domains.id'],
ondelete='CASCADE', name='domain_exists')
)
Index('domain_id', records.c.domain_id)
Index('nametype_index', records.c.name, records.c.type)
Index('rec_name_index', records.c.name)
def upgrade():
supermasters.create()
domains.create()
records.create()
def downgrade():
records.drop()
domains.drop()
supermasters.drop()

View file