mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-08-16 15:31:06 +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
40
migrations/002_devices.py
Normal file
40
migrations/002_devices.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
|
||||
# 002_devices.py
|
||||
|
||||
def migrate(migrator, database, fake=False, **kwargs):
|
||||
|
||||
# an example class for demonstrating CRUD...
|
||||
|
||||
migrator.sql("""CREATE TABLE devices(
|
||||
id serial PRIMARY KEY NOT NULL,
|
||||
name text,
|
||||
ip text,
|
||||
mac text UNIQUE,
|
||||
details text,
|
||||
uptime text,
|
||||
license text,
|
||||
interface text,
|
||||
user_name text,
|
||||
password text,
|
||||
port text,
|
||||
update_availble boolean,
|
||||
current_firmware text,
|
||||
arch text,
|
||||
upgrade_availble boolean,
|
||||
sensors text,
|
||||
router_type text,
|
||||
wifi_config text,
|
||||
peer_ip text,
|
||||
failed_attempt int DEFAULT 0,
|
||||
syslog_configured boolean,
|
||||
status text NOT NULL DEFAULT 'done',
|
||||
firmware_to_install text,
|
||||
owner uuid REFERENCES users(id),
|
||||
created timestamp not null default CURRENT_TIMESTAMP,
|
||||
modified timestamp not null default CURRENT_TIMESTAMP
|
||||
)""")
|
||||
|
||||
def rollback(migrator, database, fake=False, **kwargs):
|
||||
|
||||
migrator.sql("""DROP TABLE devices""")
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue