mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-07-03 02:24:30 +02:00
20 lines
473 B
Python
20 lines
473 B
Python
# 002_movies.py
|
|
|
|
def migrate(migrator, database, fake=False, **kwargs):
|
|
|
|
migrator.sql("""CREATE TABLE movies(
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
created timestamp not null default CURRENT_TIMESTAMP,
|
|
modified timestamp not null default CURRENT_TIMESTAMP,
|
|
|
|
creator integer REFERENCES users(id),
|
|
|
|
title text,
|
|
director text
|
|
)""")
|
|
|
|
def rollback(migrator, database, fake=False, **kwargs):
|
|
|
|
migrator.sql("""DROP TABLE movies""")
|
|
|