Add active checking
This commit is contained in:
31
init.py
Normal file
31
init.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from db import Base, User, connect_db
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
|
||||
def init():
|
||||
sync_engine = connect_db()
|
||||
Base.metadata.drop_all(sync_engine)
|
||||
Base.metadata.create_all(sync_engine)
|
||||
with Session(sync_engine) as session:
|
||||
bnd127 = User(
|
||||
username="bnd127",
|
||||
passwd="gost_2012$a742ec53198ec2a5027086fba8814a89982a57112d1a72d02260161108f39b50",
|
||||
bndname="bnd127",
|
||||
newbnd=True,
|
||||
active=True,
|
||||
upstream=False
|
||||
)
|
||||
bnd128 = User(
|
||||
username="bnd128",
|
||||
passwd="gost_2012$a742ec53198ec2a5027086fba8814a89982a57112d1a72d02260161108f39b50",
|
||||
bndname="bnd128",
|
||||
newbnd=True,
|
||||
active=True,
|
||||
upstream=False
|
||||
)
|
||||
session.add_all([bnd127, bnd128])
|
||||
session.commit()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
init()
|
||||
Reference in New Issue
Block a user