Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Fix partition constraint errors in PostgreSQL and MySQL schemas #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shinnyeonki wants to merge 1 commit into civilian7:main from shinnyeonki:main
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/exporters/mysql_exporter.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
-- =============================================
CREATE TABLE orders (
id INT NOT NULL AUTO_INCREMENT,
order_number VARCHAR(30) NOT NULL UNIQUE,
order_number VARCHAR(30) NOT NULL,
customer_id INT NOT NULL,
address_id INT NOT NULL,
staff_id INT NULL,
Expand All @@ -188,6 +188,7 @@
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id, ordered_at),
UNIQUE KEY uq_order_number (order_number, ordered_at),
INDEX idx_orders_customer (customer_id),
INDEX idx_orders_status (status),
INDEX idx_orders_ordered_at (ordered_at)
Expand Down
5 changes: 3 additions & 2 deletions src/exporters/postgresql_exporter.py
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
-- =============================================
CREATE TABLE orders (
id INT GENERATED ALWAYS AS IDENTITY,
order_number VARCHAR(30) NOT NULL UNIQUE,
order_number VARCHAR(30) NOT NULL,
customer_id INT NOT NULL,
address_id INT NOT NULL,
staff_id INT NULL,
Expand All @@ -247,7 +247,8 @@
cancelled_at TIMESTAMP NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
PRIMARY KEY (id, ordered_at)
PRIMARY KEY (id, ordered_at),
UNIQUE (order_number, ordered_at)
) PARTITION BY RANGE (ordered_at);

CREATE TABLE orders_2015 PARTITION OF orders
Expand Down

AltStyle によって変換されたページ (->オリジナル) /