mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-06-21 03:55:39 +02:00
23 lines
510 B
Python
23 lines
510 B
Python
|
|
||
|
# 006_tasks.py
|
||
|
|
||
|
def migrate(migrator, database, fake=False, **kwargs):
|
||
|
|
||
|
# an example class for demonstrating CRUD...
|
||
|
|
||
|
migrator.sql("""CREATE TABLE tasks(
|
||
|
id serial PRIMARY KEY NOT NULL,
|
||
|
signal int UNIQUE,
|
||
|
name text,
|
||
|
starttime timestamp not null default CURRENT_TIMESTAMP,
|
||
|
endtime timestamp not null default CURRENT_TIMESTAMP,
|
||
|
status boolean
|
||
|
)""")
|
||
|
|
||
|
|
||
|
|
||
|
def rollback(migrator, database, fake=False, **kwargs):
|
||
|
|
||
|
migrator.sql("""DROP TABLE tasks""")
|
||
|
|