diff --git a/Makefile b/Makefile index 9b63200..31ffe3e 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/authors.sql b/data/authors.sql similarity index 100% rename from authors.sql rename to data/authors.sql diff --git a/books.sql b/data/books.sql similarity index 100% rename from books.sql rename to data/books.sql diff --git a/course_members.sql b/data/course_members.sql similarity index 100% rename from course_members.sql rename to data/course_members.sql diff --git a/course_reviews.sql b/data/course_reviews.sql similarity index 100% rename from course_reviews.sql rename to data/course_reviews.sql diff --git a/courses.sql b/data/courses.sql similarity index 100% rename from courses.sql rename to data/courses.sql diff --git a/departments.sql b/data/departments.sql similarity index 100% rename from departments.sql rename to data/departments.sql diff --git a/drivers_passengers_rides.sql b/data/drivers_passengers_rides.sql similarity index 86% rename from drivers_passengers_rides.sql rename to data/drivers_passengers_rides.sql index e0f4005..951281c 100644 --- a/drivers_passengers_rides.sql +++ b/data/drivers_passengers_rides.sql @@ -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), diff --git a/employees.sql b/data/employees.sql similarity index 100% rename from employees.sql rename to data/employees.sql diff --git a/materials_and_colors.sql b/data/materials_and_colors.sql similarity index 100% rename from materials_and_colors.sql rename to data/materials_and_colors.sql diff --git a/orders_and_customers.sql b/data/orders_and_customers.sql similarity index 100% rename from orders_and_customers.sql rename to data/orders_and_customers.sql diff --git a/topics.sql b/data/topics.sql similarity index 100% rename from topics.sql rename to data/topics.sql diff --git a/users.sql b/data/users.sql similarity index 100% rename from users.sql rename to data/users.sql diff --git a/schema.sql b/schema.sql index 91c5636..6c1f37c 100644 --- a/schema.sql +++ b/schema.sql @@ -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 ( @@ -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), @@ -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, -);