Skip to content

Commit

Permalink
Merge pull request #83 from cloudnativedaysjp/fix/add_privary_key
Browse files Browse the repository at this point in the history
fix: Add primary key
  • Loading branch information
hrk091 authored Nov 26, 2023
2 parents 8749e49 + 888616a commit 306a6f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- migrate:up
ALTER TABLE track_viewer DROP PRIMARY KEY, ADD PRIMARY KEY(created_at,profile_id);

-- migrate:down
ALTER TABLE track_viewer DROP PRIMARY KEY, ADD PRIMARY KEY(created_at);
5 changes: 3 additions & 2 deletions internal/dkui/db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CREATE TABLE `track_viewer` (
`created_at` datetime(3) NOT NULL,
`track_name` char(1) NOT NULL,
`profile_id` int NOT NULL,
PRIMARY KEY (`created_at`)
PRIMARY KEY (`created_at`,`profile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

Expand Down Expand Up @@ -107,5 +107,6 @@ INSERT INTO `schema_migrations` (version) VALUES
('20230413013915'),
('20230413015514'),
('20230624132258'),
('20231107104801');
('20231107104801'),
('20231126063758');
UNLOCK TABLES;

0 comments on commit 306a6f5

Please sign in to comment.