36782-vm/db/migrations/011_create_client_prices_table.sql
2025-12-12 14:13:03 +00:00

9 lines
320 B
SQL

CREATE TABLE IF NOT EXISTS client_prices (
client_id INT NOT NULL,
product_id INT NOT NULL,
price DECIMAL(10, 2) NOT NULL,
PRIMARY KEY (client_id, product_id),
FOREIGN KEY (client_id) REFERENCES clients(id) ON DELETE CASCADE,
FOREIGN KEY (product_id) REFERENCES products(id) ON DELETE CASCADE
);