Skip to content

Instantly share code, notes, and snippets.

@Fykec
Last active June 14, 2017 03:45
Show Gist options
  • Save Fykec/28a68a0636c7f436876350c96241a0f5 to your computer and use it in GitHub Desktop.
Save Fykec/28a68a0636c7f436876350c96241a0f5 to your computer and use it in GitHub Desktop.
Demo: v2 to v3 sqlite3
/* 更新数据表结构*/
CREATE TABLE IF NOT EXISTS "mapping_user_plan" (
"id" integer PRIMARY KEY,
"user_id" integer,
"plan_id" integer,
"created_at" text
);
/* 也可以更新数据 */
insert into mapping_user_plan(user_id, plan_id, created_at) select 1, id, created_at from plan;
/* 最后设置 user version */
PRAGMA user_version=3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment