Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pizzeria-del-SAE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gwendal Margely
Pizzeria-del-SAE
Commits
571c9434
Commit
571c9434
authored
1 year ago
by
Gwendal Margely
Browse files
Options
Downloads
Patches
Plain Diff
add table creation SQL file
parent
95f1407a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
META-INF/tables.sql
+21
-0
21 additions, 0 deletions
META-INF/tables.sql
with
21 additions
and
0 deletions
META-INF/tables.sql
0 → 100644
+
21
−
0
View file @
571c9434
DROP
TABLE
IF
EXISTS
ingredient
CASCADE
;
CREATE
TABLE
ingredient
(
id
INTEGER
PRIMARY
KEY
,
nom
TEXT
UNIQUE
,
prix
REAL
);
DROP
TABLE
IF
EXISTS
pate
CASCADE
;
CREATE
TABLE
pate
(
id
INT
PRIMARY
KEY
,
nom
TEXT
UNIQUE
);
DROP
TABLE
IF
EXISTS
pizza
CASCADE
;
CREATE
TABLE
pizza
(
id
INTEGER
PRIMARY
KEY
,
nom
TEXT
UNIQUE
,
pate_id
INTEGER
,
prix
REAL
,
FOREIGN
KEY
(
pate_id
)
REFERENCES
pate
(
id
));
DROP
TABLE
IF
EXISTS
pizza_ingredient
;
CREATE
TABLE
pizza_ingredient
(
pizza_id
INT
,
ingredient_id
INT
,
PRIMARY
KEY
(
pizza_id
,
ingredient_id
),
FOREIGN
KEY
(
pizza_id
)
REFERENCES
pizza
(
id
)
ON
UPDATE
CASCADE
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
ingredient_id
)
REFERENCES
ingredient
(
id
)
ON
UPDATE
CASCADE
ON
DELETE
CASCADE
);
DROP
TABLE
IF
EXISTS
utilisateur
CASCADE
;
CREATE
TABLE
utilisateur
(
id
INT
PRIMARY
KEY
,
login
TEXT
,
password
TEXT
);
INSERT
INTO
utilisateur
VALUES
(
1
,
'default'
,
'default'
);
DROP
TABLE
IF
EXISTS
commande
CASCADE
;
CREATE
TABLE
commande
(
id
INT
PRIMARY
KEY
,
utilisateur_id
INT
,
date
CHAR
(
10
),
prix
REAL
,
FOREIGN
KEY
(
utilisateur_id
)
REFERENCES
utilisateur
(
id
)
ON
UPDATE
CASCADE
ON
DELETE
CASCADE
);
DROP
TABLE
IF
EXISTS
commande_pizza
;
CREATE
TABLE
commande_pizza
(
commande_id
INT
,
pizza_id
INT
,
FOREIGN
KEY
(
commande_id
)
REFERENCES
commande
(
id
)
ON
UPDATE
CASCADE
ON
DELETE
CASCADE
,
FOREIGN
KEY
(
pizza_id
)
REFERENCES
pizza
(
id
)
ON
UPDATE
CASCADE
ON
DELETE
CASCADE
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment