mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-07-14 16:04:34 +02:00
MikroWizard Initial commit | MikroMan Welcome to the world :)
This commit is contained in:
commit
8c49b9a55d
96 changed files with 12274 additions and 0 deletions
16
migrations/016_task_group_dev_rel.py
Normal file
16
migrations/016_task_group_dev_rel.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
# 032_task_group_dev_rel.py
|
||||
|
||||
def migrate(migrator, database, fake=False, **kwargs):
|
||||
|
||||
migrator.sql("""CREATE TABLE task_group_dev_rel(
|
||||
id serial PRIMARY KEY NOT NULL,
|
||||
utask_id serial REFERENCES user_tasks(id) ,
|
||||
group_id bigint NULL REFERENCES device_groups(id) default null,
|
||||
device_id bigint NULL REFERENCES devices(id) default null,
|
||||
UNIQUE(utask_id, group_id , device_id)
|
||||
)""")
|
||||
|
||||
|
||||
def rollback(migrator, database, fake=False, **kwargs):
|
||||
|
||||
migrator.sql("""DROP TABLE task_group_dev_rel""")
|
Loading…
Add table
Add a link
Reference in a new issue