|
|
|
@ -1,7 +1,5 @@
|
|
|
|
|
PRAGMA foreign_keys=off;
|
|
|
|
|
|
|
|
|
|
BEGIN TRANSACTION;
|
|
|
|
|
|
|
|
|
|
ALTER TABLE p_post_content RENAME TO _p_post_content;
|
|
|
|
|
|
|
|
|
|
ALTER TABLE p_comment_content RENAME TO _p_comment_content;
|
|
|
|
@ -53,46 +51,6 @@ CREATE TABLE p_comment_reply
|
|
|
|
|
PRIMARY KEY ("id")
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Indexes structure for table p_post_content
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
CREATE INDEX "idx_post_content_post_id"
|
|
|
|
|
ON "p_post_content" (
|
|
|
|
|
"post_id" ASC
|
|
|
|
|
);
|
|
|
|
|
CREATE INDEX "idx_post_content_user_id"
|
|
|
|
|
ON "p_post_content" (
|
|
|
|
|
"user_id" ASC
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Indexes structure for table p_comment_reply
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
CREATE INDEX "idx_comment_reply_comment_id"
|
|
|
|
|
ON "p_comment_reply" (
|
|
|
|
|
"comment_id" ASC
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Indexes structure for table p_comment_content
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
CREATE INDEX "idx_comment_content_comment_id"
|
|
|
|
|
ON "p_comment_content" (
|
|
|
|
|
"comment_id" ASC
|
|
|
|
|
);
|
|
|
|
|
CREATE INDEX "idx_comment_content_sort"
|
|
|
|
|
ON "p_comment_content" (
|
|
|
|
|
"sort" ASC
|
|
|
|
|
);
|
|
|
|
|
CREATE INDEX "idx_comment_content_type"
|
|
|
|
|
ON "p_comment_content" (
|
|
|
|
|
"type" ASC
|
|
|
|
|
);
|
|
|
|
|
CREATE INDEX "idx_comment_content_user_id"
|
|
|
|
|
ON "p_comment_content" (
|
|
|
|
|
"user_id" ASC
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
INSERT INTO p_post_content (id, post_id, user_id, content, `type`, sort, created_on, modified_on, deleted_on, is_del)
|
|
|
|
|
SELECT id, post_id, user_id, content, `type`, sort, created_on, modified_on, deleted_on, is_del
|
|
|
|
|
FROM _p_post_content;
|
|
|
|
@ -112,10 +70,12 @@ DROP TABLE _p_comment_reply;
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Indexes structure for table p_post_content
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP INDEX IF EXISTS "idx_post_content_post_id";
|
|
|
|
|
CREATE INDEX "idx_post_content_post_id"
|
|
|
|
|
ON "p_post_content" (
|
|
|
|
|
"post_id" ASC
|
|
|
|
|
);
|
|
|
|
|
DROP INDEX IF EXISTS "idx_post_content_user_id";
|
|
|
|
|
CREATE INDEX "idx_post_content_user_id"
|
|
|
|
|
ON "p_post_content" (
|
|
|
|
|
"user_id" ASC
|
|
|
|
@ -124,6 +84,7 @@ ON "p_post_content" (
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Indexes structure for table p_comment_reply
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP INDEX IF EXISTS "idx_comment_reply_comment_id";
|
|
|
|
|
CREATE INDEX "idx_comment_reply_comment_id"
|
|
|
|
|
ON "p_comment_reply" (
|
|
|
|
|
"comment_id" ASC
|
|
|
|
@ -132,23 +93,25 @@ ON "p_comment_reply" (
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
-- Indexes structure for table p_comment_content
|
|
|
|
|
-- ----------------------------
|
|
|
|
|
DROP INDEX IF EXISTS "idx_comment_content_comment_id";
|
|
|
|
|
CREATE INDEX "idx_comment_content_comment_id"
|
|
|
|
|
ON "p_comment_content" (
|
|
|
|
|
"comment_id" ASC
|
|
|
|
|
);
|
|
|
|
|
DROP INDEX IF EXISTS "idx_comment_content_sort";
|
|
|
|
|
CREATE INDEX "idx_comment_content_sort"
|
|
|
|
|
ON "p_comment_content" (
|
|
|
|
|
"sort" ASC
|
|
|
|
|
);
|
|
|
|
|
DROP INDEX IF EXISTS "idx_comment_content_type";
|
|
|
|
|
CREATE INDEX "idx_comment_content_type"
|
|
|
|
|
ON "p_comment_content" (
|
|
|
|
|
"type" ASC
|
|
|
|
|
);
|
|
|
|
|
DROP INDEX IF EXISTS "idx_comment_content_user_id";
|
|
|
|
|
CREATE INDEX "idx_comment_content_user_id"
|
|
|
|
|
ON "p_comment_content" (
|
|
|
|
|
"user_id" ASC
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
|
|
|
|
|
|
PRAGMA foreign_keys=on;
|
|
|
|
|