Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team 5 - Smart Towns
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Rhys Evans
Team 5 - Smart Towns
Commits
e847822d
Commit
e847822d
authored
1 year ago
by
Gabriel Copat
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted schema.sql to be more readable;
parent
1ac09504
No related branches found
Branches containing commit
No related tags found
1 merge request
!37
Resolve "As a repeat trail visitor , I want to be able to create an account so I can save and review my progress."
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/Team5/SmartTowns/rewards/RewardsRepositoryJDBC.java
+0
-1
0 additions, 1 deletion
.../java/Team5/SmartTowns/rewards/RewardsRepositoryJDBC.java
src/main/resources/schema.sql
+29
-30
29 additions, 30 deletions
src/main/resources/schema.sql
with
29 additions
and
31 deletions
src/main/java/Team5/SmartTowns/rewards/RewardsRepositoryJDBC.java
+
0
−
1
View file @
e847822d
...
...
@@ -10,7 +10,6 @@ import java.util.List;
@Repository
public
class
RewardsRepositoryJDBC
implements
RewardsRepository
{
private
final
JdbcTemplate
jdbc
;
private
RowMapper
<
Badge
>
badgeMapper
;
private
RowMapper
<
Sticker
>
stickerMapper
;
private
RowMapper
<
Pack
>
packMapper
;
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/schema.sql
+
29
−
30
View file @
e847822d
drop
table
if
exists
trails
;
create
table
if
not
exists
trails
(
/* DELETES AND RECREATES DATABASE EVERY TIME THE SYSTEM IS BOOTED*/
DROP
DATABASE
IF
EXISTS
towns
;
CREATE
DATABASE
IF
NOT
EXISTS
towns
;
USE
towns
;
/****************************************************************/
/* DROPS ALL TABLES IF THEY EXIST (they wont but just in case) */
DROP
TABLE
IF
EXISTS
trails
;
DROP
TABLE
IF
EXISTS
locations
;
DROP
TABLE
IF
EXISTS
users
;
DROP
TABLE
IF
EXISTS
stickers
;
DROP
TABLE
IF
EXISTS
packs
;
DROP
TABLE
IF
EXISTS
stickerProgress
;
/****************************************************************/
/* CREATES ALL TABLES */
CREATE
TABLE
IF
NOT
EXISTS
trails
(
trailID
bigint
auto_increment
primary
key
,
name
varchar
(
128
)
)
engine
=
InnoDB
;
);
drop
table
if
exists
locations
;
create
table
if
not
exists
locations
(
CREATE
TABLE
IF
NOT
EXISTS
locations
(
locationID
bigint
auto_increment
primary
key
,
locationName
varchar
(
128
),
locationEmail
varchar
(
128
),
locationDescription
longtext
,
locationPlace
varchar
(
255
),
locationTrailID
varchar
(
128
)
)
engine
=
InnoDB
;
drop
table
if
exists
users
;
drop
table
if
exists
stickers
;
drop
table
if
exists
packs
;
drop
table
if
exists
stickerProgress
;
);
create
table
if
not
exists
users
(
CREATE
TABLE
IF
NOT
EXISTS
users
(
id
bigint
auto_increment
primary
key
,
email
varchar
(
128
)
NOT
NULL
,
name
varchar
(
30
),
dragonProgress
int
,
dragonsLandmarkIDs
longtext
)
engine
=
InnoDB
;
);
create
table
if
not
exists
packs
(
CREATE
TABLE
IF
NOT
EXISTS
packs
(
id
bigint
auto_increment
primary
key
,
name
varchar
(
20
),
description
text
)
engine
=
InnoDB
;
);
create
table
if
not
exists
stickers
(
CREATE
TABLE
IF
NOT
EXISTS
stickers
(
id
bigint
auto_increment
primary
key
,
packID
bigint
,
FOREIGN
KEY
(
packID
)
REFERENCES
packs
(
id
)
...
...
@@ -51,14 +53,11 @@ create table if not exists stickers
name
varchar
(
30
),
description
text
,
rarity
tinyint
);
)
engine
=
InnoDB
;
create
table
if
not
exists
stickerProgress
(
CREATE
TABLE
IF
NOT
EXISTS
stickerProgress
(
id
bigint
auto_increment
primary
key
,
userID
bigint
,
packID
bigint
,
stickerID
bigint
)
engine
=
InnoDB
;
);
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