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
fd1a8aa0
Commit
fd1a8aa0
authored
1 year ago
by
Gwendal Margely
Browse files
Options
Downloads
Patches
Plain Diff
inverting commande and utilisateur table in sql creation
parent
6b020217
No related branches found
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
+4
-4
4 additions, 4 deletions
META-INF/tables.sql
with
4 additions
and
4 deletions
META-INF/tables.sql
+
4
−
4
View file @
fd1a8aa0
...
@@ -7,9 +7,9 @@ CREATE TABLE pate (id SERIAL PRIMARY KEY, nom TEXT UNIQUE);
...
@@ -7,9 +7,9 @@ CREATE TABLE pate (id SERIAL PRIMARY KEY, nom TEXT UNIQUE);
DROP
TABLE
IF
EXISTS
pizza
CASCADE
;
DROP
TABLE
IF
EXISTS
pizza
CASCADE
;
CREATE
TABLE
pizza
(
id
SERIAL
PRIMARY
KEY
,
nom
TEXT
UNIQUE
,
pate_id
INTEGER
,
prix
REAL
,
FOREIGN
KEY
(
pate_id
)
REFERENCES
pate
(
id
));
CREATE
TABLE
pizza
(
id
SERIAL
PRIMARY
KEY
,
nom
TEXT
UNIQUE
,
pate_id
INTEGER
,
prix
REAL
,
FOREIGN
KEY
(
pate_id
)
REFERENCES
pate
(
id
));
DROP
TABLE
IF
EXISTS
commande
CASCADE
;
CREATE
TABLE
commande
(
id
SERIAL
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
utilisateur
CASCADE
;
DROP
TABLE
IF
EXISTS
utilisateur
CASCADE
;
CREATE
TABLE
utilisateur
(
id
SERIAL
PRIMARY
KEY
,
login
TEXT
UNIQUE
,
password
TEXT
);
CREATE
TABLE
utilisateur
(
id
SERIAL
PRIMARY
KEY
,
login
TEXT
UNIQUE
,
password
TEXT
);
INSERT
INTO
utilisateur
VALUES
(
1
,
'default'
,
'default'
);
INSERT
INTO
utilisateur
VALUES
(
1
,
'default'
,
'default'
);
\ No newline at end of file
DROP
TABLE
IF
EXISTS
commande
CASCADE
;
CREATE
TABLE
commande
(
id
SERIAL
PRIMARY
KEY
,
utilisateur_id
INT
,
date
CHAR
(
10
),
prix
REAL
,
FOREIGN
KEY
(
utilisateur_id
)
REFERENCES
utilisateur
(
id
)
ON
UPDATE
CASCADE
ON
DELETE
CASCADE
);
\ No newline at end of file
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