model.py 733 Bytes
Newer Older
Bernhard Rumpe's avatar
BR-sy  
Bernhard Rumpe committed
1
# (c) https://github.com/MontiCore/monticore  
2 3
from peewee import *

hengwen's avatar
hengwen committed
4
db = SqliteDatabase("app.db")
5 6 7 8 9 10 11 12 13 14 15 16 17


class Map(Model):
    name = CharField(null=False)
    path = CharField(null=False)

    class Meta:
        database = db


class Simulation(Model):
    num_sectors = IntegerField(null=True)
    scenario_id = IntegerField(null=True)
hengwen's avatar
hengwen committed
18
    result_path = CharField(null=True)
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

    class Meta:
        database = db


class Scenario(Model):
    name = CharField(null=False)
    path = CharField(null=False)

    class Meta:
        database = db


Map.drop_table(safe=True)
Map.create_table(safe=True)

Simulation.drop_table(safe=True)
Simulation.create_table(safe=True)

Scenario.drop_table(safe=True)
Scenario.create_table(safe=True)