Skip to content

Commit

Permalink
Added blogs to db
Browse files Browse the repository at this point in the history
  • Loading branch information
miguel-merlin committed Oct 5, 2024
1 parent 0e13fba commit aaa89d7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion initdb/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ create table teams (
team_class int not null
);


create table blogs (
id bigint primary key generated always as identity,
author varchar(255) not null,
title varchar(255) not null,
date_created timestamp not null
)

alter table users
add constraint fk_team_id
foreign key (team_id) references teams(id);
Expand Down Expand Up @@ -70,4 +78,10 @@ insert into teams (name, team_lead_id, team_manager_id, date_created, team_class
insert into user_roles (user_id, role_id) values
(1, 1), -- John Doe with E-BOARD role
(2, 2), -- Jane Smith with TEAM_LEAD role
(3, 3); -- Michael Johnson with PRODUCT_MANAGER role
(3, 3); -- Michael Johnson with PRODUCT_MANAGER role

-- Insert blogs to the blogs table
insert into blogs (author, title, date_created) values
('John Doe', 'Blog 1', CURRENT_TIMESTAMP),
('Jane Smith', 'Blog 2', CURRENT_TIMESTAMP),
('Michael Johnson', 'Blog 3', CURRENT_TIMESTAMP);

0 comments on commit aaa89d7

Please sign in to comment.