mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-07-31 08:05:11 +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
25
migrations/007_events.py
Normal file
25
migrations/007_events.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
|
||||
# 009_events.py
|
||||
|
||||
def migrate(migrator, database, fake=False, **kwargs):
|
||||
|
||||
# an example class for demonstrating CRUD...
|
||||
|
||||
migrator.sql("""CREATE TABLE events(
|
||||
id bigserial PRIMARY KEY NOT NULL,
|
||||
devid bigint REFERENCES devices(id),
|
||||
eventtype text,
|
||||
comment text,
|
||||
status boolean,
|
||||
detail text,
|
||||
level text,
|
||||
src text,
|
||||
fixtime timestamp null default null,
|
||||
eventtime timestamp not null default CURRENT_TIMESTAMP
|
||||
)""")
|
||||
|
||||
|
||||
def rollback(migrator, database, fake=False, **kwargs):
|
||||
|
||||
migrator.sql("""DROP TABLE events""")
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue