]> andersk Git - sql.git/blame - lib/python/mitsql/db.py
begin restructuring
[sql.git] / lib / python / mitsql / db.py
CommitLineData
82981855 1from elixir import Entity, Field, String, Text, Integer, DateTime, options, metadata, setup_all, session
562fda3a
JP
2from sqlalchemy import create_engine, func
3options.options_defaults['shortnames'] = True
4
82981855
JP
5class Backup(Entity):
6 db = Field(String(256), primary_key=True)
7 skip_reason = Field(String(256), nullable=True)
8 skip_date = Field(DateTime(), nullable=True)
9 dump_path = Field(String(512), nullable=True)
10 dump_errnum = Field(Integer(4), nullable=True)
11 dump_errstr = Field(Text(), nullable=True)
12 dump_date = Field(DateTime(), nullable=True)
13
562fda3a
JP
14metadata.bind = create_engine('mysql://sql.mit.edu/mitsql?read_default_group=mysql', pool_recycle=True)
15
16if __name__ == '__main__':
17 setup_all(True)
18else:
19 setup_all()
20session.flush()
This page took 0.204435 seconds and 5 git commands to generate.