-
Notifications
You must be signed in to change notification settings - Fork 1
/
db_create.py
72 lines (59 loc) · 2.44 KB
/
db_create.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from config import SQLALCHEMY_DATABASE_URI
from app import db
from app import models
if 1==1:
print "dropping tables"
db.drop_all()
print "creating tables"
db.create_all()
if 1==1:
db.session.add_all([
models.Category('Visual Novel', 1, True, 'vn'),
models.Category('Kinetic Novel', 1, True, 'kn'),
models.Category('Role-Playing Game', 1, True, 'rpg'),
models.Category('Simulation', 1, True, 'sim'),
models.Category('Tactics', 1, False, 'tactics'),
models.Category('Other Gameplay', 1, True, 'uncategorized'),
models.Category('Boy pursues Girl', 2, True, 'BxG'),
models.Category('Boy pursues Boy', 2, True, 'BxB'),
models.Category('Girl pursues Boy', 2, True, 'GxB'),
models.Category('Girl pursues Girl', 2, True, 'GxG'),
models.Category('Mystery', 3, True, 'mystery'),
models.Category('Parody', 3, True, 'parody'),
models.Category('Commercial', 4, False, 'commercial'),
models.Category('NaNoRenO', 4, False, 'nanoreno'),
models.Category('Teacup Festival', 4, False, 'teacup')])
db.session.add_all([
models.CategoryGroup('By Gameplay', True),
models.CategoryGroup('By Relationship', True),
models.CategoryGroup('By Genre', True),
models.CategoryGroup('Extra', False)])
renpy = "Ren'Py"
db.session.add_all([
models.Engine(renpy),
models.Engine('Novelty'),
models.Engine('Flash'),
models.Engine('Other')])
db.session.add_all([
models.LinkType('homepage')])
db.session.add_all([
models.Platform('Windows'),
models.Platform('Mac OS X'),
models.Platform('Linux'),
models.Platform('Other')])
# db.session.add_all([
# models.UserAccount('admin', '21232f297a57a5a743894a0e4a801fc3', '', 1, 1)]) #TEST. REMOVE THIS!
db.session.add_all([
models.AgeRating('All ages', 'All ages, no sexual content', False),
models.AgeRating('13+', 'Perhaps some sexual themes, no nudity', False),
models.AgeRating('16+', 'Nonexplicit nudity, off-camera sex', False),
models.AgeRating('18+', 'Adult, anything goes', True)
])
db.session.add_all([
models.Group('undefined')])
db.session.add_all([
models.Person('undefined')])
db.session.add_all([
models.Developer('undefined')])
print "commiting changes"
db.session.commit()