Skip to content

Commit

Permalink
Tables renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
dukris committed Feb 13, 2024
1 parent c8a1dcd commit e62950f
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 29 deletions.
23 changes: 23 additions & 0 deletions src/main/resources/db/changelog/2024/003-naming.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2023-2024 Tracehub.git
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to read
* the Software only. Permissions is hereby NOT GRANTED to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

--liquibase formatted sql

--changeset hizmailovich:1
ALTER TABLE projects.projects RENAME TO project;
ALTER TABLE projects.performers RENAME TO performer;
ALTER TABLE projects.tickets RENAME TO ticket;
8 changes: 4 additions & 4 deletions src/main/resources/sql/insert-project.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
* SOFTWARE.
*/

INSERT INTO projects.projects (name,
location,
description,
active)
INSERT INTO projects.project (name,
location,
description,
active)
VALUES (?, ?, ?, ?)
RETURNING id,
name,
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/sql/insert-ticket.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* SOFTWARE.
*/

INSERT INTO projects.tickets (project,
number,
repo,
job,
status)
INSERT INTO projects.ticket (project,
number,
repo,
job,
status)
VALUES (?, ?, ?, ?, ?)
RETURNING id,
project,
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/sql/select-project-by-id.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ SELECT id,
location,
description,
active
FROM projects.projects
FROM projects.project
WHERE id = ?;
6 changes: 3 additions & 3 deletions src/main/resources/sql/select-projects-by-user-email.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ SELECT p.id,
p.location,
p.description,
p.active
FROM projects.projects p
INNER JOIN projects.performers on p.id = performers.project
WHERE performers.email = ?;
FROM projects.project p
INNER JOIN projects.performer on p.id = performer.project
WHERE performer.email = ?;
2 changes: 1 addition & 1 deletion src/main/resources/sql/select-ticket-by-job-and-repo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ SELECT id,
repo,
job,
status
FROM projects.tickets
FROM projects.ticket
WHERE job = ? AND repo = ?;
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ SELECT id,
repo,
job,
status
FROM projects.tickets
FROM projects.ticket
WHERE number = ? AND repo = ?;
28 changes: 14 additions & 14 deletions src/test/resources/pre/sql/projects.sql
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
INSERT INTO projects.projects (id,
name,
location,
description,
active)
INSERT INTO projects.project (id,
name,
location,
description,
active)
VALUES ('74bb5ec8-0e6b-4618-bfa4-a0b76b7b312d',
'Test',
'github@user/test:master',
'Description',
true)
ON CONFLICT (id) DO NOTHING;

INSERT INTO projects.performers (email,
project,
permission)
INSERT INTO projects.performer (email,
project,
permission)
VALUES ('user',
'74bb5ec8-0e6b-4618-bfa4-a0b76b7b312d',
'READ');

INSERT INTO projects.tickets(id,
project,
number,
repo,
job,
status)
INSERT INTO projects.ticket(id,
project,
number,
repo,
job,
status)
VALUES ('04986038-6e38-4928-b12e-644c99f9cadc',
'74bb5ec8-0e6b-4618-bfa4-a0b76b7b312d',
1,
Expand Down

0 comments on commit e62950f

Please sign in to comment.