##// END OF EJS Templates
Updated database model, with FK and Booleans
Marcin Kuzminski -
r61:1b6d7662 default
parent child Browse files
Show More
@@ -12,13 +12,15 b' class Users(Base):'
12 user_id = Column("user_id", SLInteger(), nullable=False, unique=True, default=None, primary_key=1)
12 user_id = Column("user_id", SLInteger(), nullable=False, unique=True, default=None, primary_key=1)
13 username = Column("username", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
13 username = Column("username", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
14 password = Column("password", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
14 password = Column("password", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
15 active = Column("active", SLInteger(), nullable=True, unique=None, default=None)
15 active = Column("active", SLBoolean(), nullable=True, unique=None, default=None)
16 admin = Column("admin", SLInteger(), nullable=True, unique=None, default=None)
16 admin = Column("admin", SLBoolean(), nullable=True, unique=None, default=None)
17
17 action_log = relation('UserLogs')
18
18 class UserLogs(Base):
19 class UserLogs(Base):
19 __tablename__ = 'user_logs'
20 __tablename__ = 'user_logs'
20 __table_args__ = {'useexisting':True}
21 __table_args__ = {'useexisting':True}
21 id = Column("id", SLInteger(), nullable=False, unique=True, default=None, primary_key=1)
22 id = Column("id", SLInteger(), nullable=False, unique=True, default=None, primary_key=1)
22 user_id = Column("user_id", SLInteger(), nullable=True, unique=None, default=None)
23 user_id = Column("user_id", SLInteger(), ForeignKey(u'users.user_id'), nullable=True, unique=None, default=None)
23 last_action = Column("last_action", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
24 last_action = Column("last_action", SLText(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
24 last_action_date = Column("last_action_date", SLDateTime(timezone=False), nullable=True, unique=None, default=None)
25 last_action_date = Column("last_action_date", SLDateTime(timezone=False), nullable=True, unique=None, default=None)
26 user = relation('Users')
General Comments 0
You need to be logged in to leave comments. Login now