mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-06-24 22:28:38 +02:00
24 lines
580 B
Python
24 lines
580 B
Python
|
# 001_init.py
|
||
|
|
||
|
def migrate(migrator, database, fake=False, **kwargs):
|
||
|
"""Write your migrations here."""
|
||
|
|
||
|
migrator.sql("""CREATE TABLE users (
|
||
|
|
||
|
id INTEGER PRIMARY KEY,
|
||
|
|
||
|
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
||
|
email text UNIQUE,
|
||
|
password text,
|
||
|
first_name text,
|
||
|
last_name text,
|
||
|
role text DEFAULT 'readonly',
|
||
|
tags text
|
||
|
)""")
|
||
|
|
||
|
def rollback(migrator, database, fake=False, **kwargs):
|
||
|
"""Write your rollback migrations here."""
|
||
|
|