From 7cd2705f9f1b07ec4ebb562172e37fab4b6117d7 Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Thu, 4 Apr 2024 17:27:20 +0500 Subject: [PATCH] fix data --- Makefile | 18 +++++++++++++----- authors.sql => data/authors.sql | 0 books.sql => data/books.sql | 0 course_members.sql => data/course_members.sql | 0 course_reviews.sql => data/course_reviews.sql | 0 courses.sql => data/courses.sql | 0 departments.sql => data/departments.sql | 0 .../drivers_passengers_rides.sql | 2 +- employees.sql => data/employees.sql | 0 .../materials_and_colors.sql | 0 .../orders_and_customers.sql | 0 topics.sql => data/topics.sql | 0 users.sql => data/users.sql | 0 schema.sql | 11 ++++------- 14 files changed, 18 insertions(+), 13 deletions(-) rename authors.sql => data/authors.sql (100%) rename books.sql => data/books.sql (100%) rename course_members.sql => data/course_members.sql (100%) rename course_reviews.sql => data/course_reviews.sql (100%) rename courses.sql => data/courses.sql (100%) rename departments.sql => data/departments.sql (100%) rename drivers_passengers_rides.sql => data/drivers_passengers_rides.sql (86%) rename employees.sql => data/employees.sql (100%) rename materials_and_colors.sql => data/materials_and_colors.sql (100%) rename orders_and_customers.sql => data/orders_and_customers.sql (100%) rename topics.sql => data/topics.sql (100%) rename users.sql => data/users.sql (100%) 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, -);