forked from Nicknamezz00-organization/gorder-v2-org-view
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sql
More file actions
16 lines (13 loc) · 608 Bytes
/
init.sql
File metadata and controls
16 lines (13 loc) · 608 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
CREATE DATABASE IF NOT EXISTS gorder_v2;
USE gorder_v2;
DROP TABLE IF EXISTS `o_stock`;
CREATE TABLE `o_stock` (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
product_id VARCHAR(255) NOT NULL,
quantity INT UNSIGNED NOT NULL DEFAULT 0,
version INT NOT NULL DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO o_stock (product_id, quantity, version)
VALUES ('prod_R3g7MikGYsXKzr', 1000, 0), ('prod_R285C3Wb7FDprc', 500, 0);