forked from moloch--/RootTheBox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_database.py
More file actions
59 lines (46 loc) · 1.79 KB
/
Copy pathcreate_database.py
File metadata and controls
59 lines (46 loc) · 1.79 KB
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
# -*- coding: utf-8 -*-
'''
@author: moloch
Copyright 2013
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
'''
from models import engine
from models.BaseModels import DatabaseObject
def create_tables(sqla_engine, sqla_metadata, echo=False):
''' Create all the tables '''
setattr(sqla_engine, 'echo', echo)
sqla_metadata.create_all(sqla_engine)
metadata = DatabaseObject.metadata
# Create secondary tables
from models.Relationships import *
# Import your models here
from models.Box import Box
from models.PasteBin import PasteBin
from models.Permission import Permission
from models.Team import Team
from models.User import User
from models.FileUpload import FileUpload
from models.WallOfSheep import WallOfSheep
from models.Flag import Flag
from models.Notification import Notification
from models.Corporation import Corporation
from models.GameLevel import GameLevel
from models.Theme import Theme
from models.RegistrationToken import RegistrationToken
from models.MarketItem import MarketItem
from models.IpAddress import IpAddress
from models.Snapshot import Snapshot
from models.SnapshotTeam import SnapshotTeam
from models.SourceCode import SourceCode
from models.Swat import Swat
from models.Hint import Hint
#from models.Sponsor import Sponsor
#from models.BoxResource import BoxResource