forked from binay-jana/RoboticsContestScoringSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathload.py
More file actions
26 lines (21 loc) · 669 Bytes
/
load.py
File metadata and controls
26 lines (21 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
from initialize_registry import load_registry
import registry as r
import MySQLdb
from constants import settings
def run():
db = MySQLdb.connect(
host=settings.mysql_host,
port=settings.mysql_port,
user=settings.mysql_user,
passwd=settings.mysql_password)
db.query('CREATE DATABASE IF NOT EXISTS scoring_system;')
load_registry()
r.get_registry()['MY_SQL'].query(
'ALTER DATABASE scoring_system CHARACTER SET '
'utf8 COLLATE utf8_general_ci;'
)
r.get_registry()['ROBOTS'].create_table()
r.get_registry()['RUNS'].create_table()
if __name__ == "__main__":
run()