-
Notifications
You must be signed in to change notification settings - Fork 0
/
createDb.py
106 lines (97 loc) · 2.15 KB
/
createDb.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import sqlite3, os
dbfile = "data/portal-just.db"
# clean-up first
# remove previous dbfile if exists
try:
os.remove(dbfile)
print(f"{dbfile} removed successfully")
except FileNotFoundError:
print(f"{dbfile} does not exist")
conn = sqlite3.connect(dbfile)
c = conn.cursor()
"""
Dosar
DosarParte
DosarSedinta
DosarCaleAtac
Sedinta
SedintaDosar
"""
c.execute(
"""
CREATE TABLE "Dosar" (
"xnr" TEXT NOT NULL UNIQUE,
"numar" TEXT NOT NULL,
"Numar vechi" TEXT,
"data" TEXT,
"institutie" TEXT,
"categorieCaz" TEXT,
"stadiuProcesual" TEXT,
"parti" TEXT,
"sedinte" TEXT,
"caiAtac" TEXT
)
"""
)
c.execute(
"""
CREATE TABLE "DosarParte" (
"xnumardosar" TEXT NOT NULL,
"nume" TEXT,
"calitateParte" TEXT
)
"""
)
c.execute(
"""
CREATE TABLE "DosarSedinta" (
"xnumardosar" TEXT NOT NULL,
"complet" TEXT,
"data" TEXT,
"ora" TEXT,
"soluţie" TEXT,
"soluţieSumar" TEXT,
"dataPronuntare" TEXT,
"documentSedinta" TEXT,
"numarDocument" TEXT,
"dataDocument" TEXT
)
"""
)
c.execute(
"""
CREATE TABLE "DosarCaleAtac" (
"xnumardosar" TEXT NOT NULL,
"dataDeclarare" TEXT,
"parteDeclaratoare" TEXT,
"tipCaleAtac" TEXT
)
"""
)
c.execute(
"""
CREATE TABLE "Sedinta" (
"xnrsedinta" ID PRIMARY KEY,
"departament" TEXT,
"complet" TEXT,
"data" TEXT,
"ora" TEXT,
"dosare" TEXT
)
"""
)
c.execute(
"""
CREATE TABLE "SedintaDosar" (
"xnrsedinta" INT NOT NULL,
"numar" TEXT NOT NULL UNIQUE,
"numar vechi" TEXT,
"data" TEXT,
"ora" TEXT,
"categorieCaz" TEXT,
"stadiuProcesual" TEXT
)
"""
)
conn.commit()
print('created ' + dbfile)