Skip to content

Commit

Permalink
after.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
kazeburo authored and catatsuy committed Aug 29, 2019
1 parent 8dd5f20 commit e2bae95
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webapp/sql/after.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- mysql> alter table items add root_category_id int unsigned NOT NULL after category_id;
-- Query OK, 0 rows affected (1.60 sec)
-- Records: 0 Duplicates: 0 Warnings: 0
-- mysql> update items i join categories c on i.category_id=c.id set i.root_category_id = c.parent_id;
-- Query OK, 50162 rows affected (0.44 sec)
-- Rows matched: 50162 Changed: 50162 Warnings: 0
alter table items add root_category_id int unsigned NOT NULL after category_id;
alter table items add index idx_root_category(root_category_id,created_at);
update items i join categories c on i.category_id=c.id set i.root_category_id = c.parent_id;

0 comments on commit e2bae95

Please sign in to comment.