-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimplexPro.sql
More file actions
63 lines (58 loc) · 2.96 KB
/
simplexPro.sql
File metadata and controls
63 lines (58 loc) · 2.96 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
57
58
59
60
61
62
63
-- Tabla para almacenar los problemas de programación lineal
CREATE TABLE problemaPL (
problemaID TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-a' || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6)))),
titulo TEXT NOT NULL,
descripcion TEXT,
tipoOptimizacion TEXT NOT NULL CHECK(tipoOptimizacion IN ('MAX', 'MIN')),
funcionObjetivo TEXT,
fechaCreacion DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- Tabla para almacenar las variables asociadas a un problema
CREATE TABLE variables (
variableID TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-a' || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6)))),
variable TEXT NOT NULL,
nombre TEXT,
problemaID TEXT NOT NULL,
fechaCreacion DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (problemaID) REFERENCES problemaPL(problemaID) ON DELETE CASCADE
);
-- Tabla para almacenar los métodos gráficos
CREATE TABLE metodoGrafico (
metodoGraficoID TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-a' || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6)))),
problemaID TEXT NOT NULL,
valoresFO TEXT,
mensaje TEXT,
grafico BLOB,
fechaCreacion DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (problemaID) REFERENCES problemaPL(problemaID) ON DELETE CASCADE
);
-- Tabla para almacenar los métodos simples
CREATE TABLE metodoSimple (
metodoSimpleID TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-a' || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6)))),
problemaID TEXT NOT NULL,
valorFo TEXT,
mensaje TEXT,
fechaCreacion DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (problemaID) REFERENCES problemaPL(problemaID) ON DELETE CASCADE
);
CREATE TABLE iteracionSimple (
iteracionID INTEGER PRIMARY KEY AUTOINCREMENT,
metodoSimpleID TEXT NOT NULL,
iteracion INT NOT NULL,
entra TEXT,
sale TEXT,
razonMinima REAL,
elementoPivote REAL,
tabla TEXT,
fechaCreacion DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (metodoSimpleID) REFERENCES metodoSimple(metodoSimpleID) ON DELETE CASCADE
);
-- Tabla para almacenar las restricciones
CREATE TABLE restricciones (
restriccionID TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-a' || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6)))),
problemaID TEXT NOT NULL,
inecuacion TEXT NOT NULL,
glosa TEXT,
fechaCreacion DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (problemaID) REFERENCES problemaPL(problemaID) ON DELETE CASCADE
);