Updating sql to be more generic and biznizzy
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
CREATE DATABASE collector;
|
||||
\c collector
|
||||
|
||||
-- Modeling the stores that we track overall
|
||||
-- Modeling the businesses that we track overall
|
||||
CREATE TABLE businesses (
|
||||
store_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
store_name VARCHAR(255) NOT NULL
|
||||
business_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
business_name VARCHAR(255) NOT NULL
|
||||
);
|
||||
|
||||
-- Modeling the products
|
||||
@@ -14,7 +14,7 @@ CREATE TABLE products (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
|
||||
-- Store-specific Identifiers
|
||||
business_id UUID REFERENCES businesses (store_id) NOT NULL,
|
||||
business_id UUID REFERENCES businesses (business_id) NOT NULL,
|
||||
|
||||
-- Product Details
|
||||
product_name VARCHAR(255) NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user