mirror of
https://github.com/3ybactuk/marketplace-go-service-project.git
synced 2025-10-30 14:03:45 +03:00
[hw-8] add: repo layer
This commit is contained in:
10
comments/db/migrations/00001_create_comments.sql
Normal file
10
comments/db/migrations/00001_create_comments.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE comments (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
user_id BIGINT NOT NULL,
|
||||
sku BIGINT NOT NULL,
|
||||
text VARCHAR(255) NOT NULL,
|
||||
created_at TIMESTAMP(3) NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX ON comments(sku, created_at DESC, user_id ASC);
|
||||
CREATE INDEX ON comments(user_id, created_at DESC);
|
||||
Reference in New Issue
Block a user