Skip to content

Commit

Permalink
fix data
Browse files Browse the repository at this point in the history
  • Loading branch information
fey committed Apr 4, 2024
1 parent 11f4a38 commit 7cd2705
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 13 deletions.
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ schema-load:
psql hexlet < schema.sql

data-load:
psql hexlet < users.sql
psql hexlet < topics.sql
psql hexlet < courses.sql
psql hexlet < course_members.sql
psql hexlet < course_reviews.sql
psql hexlet < data/users.sql
psql hexlet < data/topics.sql
psql hexlet < data/courses.sql
psql hexlet < data/course_members.sql
psql hexlet < data/course_reviews.sql

psql hexlet < data/authors.sql
psql hexlet < data/books.sql
psql hexlet < data/departments.sql
psql hexlet < data/drivers_passengers_rides.sql
psql hexlet < data/employees.sql
psql hexlet < data/materials_and_colors.sql
psql hexlet < data/orders_and_customers.sql

generate:
node ./bin/load.js
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INSERT INTO passengers (passenger_id, passenger_name, phone) VALUES
(102, 'Соколова Ж.З.', '+72228889900'),
(103, 'Ястребов И.К.', '+73339995566');

INSERT INTO rides (rideid, driver_id, passenger_id, price) VALUES
INSERT INTO rides (ride_id, driver_id, passenger_id, price) VALUES
(1001, 1, 101, 567),
(1002, 1, 102, 234),
(1003, 2, 103, 1234),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 4 additions & 7 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ CREATE TABLE employees (
employee_id INT PRIMARY KEY,
department_id INT,
name VARCHAR(50),
salary DECIMAL(10, 2)
salary DECIMAL(10, 2),
position VARCHAR,
manager_id int
);

CREATE TABLE drivers (
Expand All @@ -98,7 +100,7 @@ CREATE TABLE passengers (
);

CREATE TABLE rides (
rideid INT PRIMARY KEY,
ride_id INT PRIMARY KEY,
driver_id INT,
passenger_id INT,
price DECIMAL(10, 2),
Expand All @@ -117,8 +119,3 @@ CREATE TABLE orders (
customer_id INT,
total_price DECIMAL(10, 2)
);

CREATE TABLE employees_with_managers (
employee_id INT PRIMARY KEY,
employee_name VARCHAR,
);

0 comments on commit 7cd2705

Please sign in to comment.