-
Notifications
You must be signed in to change notification settings - Fork 589
/
Update_SQLite.sql
29 lines (29 loc) · 1.12 KB
/
Update_SQLite.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
CREATE TABLE `typecho_links_upgrade` (
`lid` INTEGER NOT NULL PRIMARY KEY,
`name` varchar(50) DEFAULT NULL,
`url` varchar(200) DEFAULT NULL,
`sort` varchar(50) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`image` varchar(200) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`user` varchar(200) DEFAULT NULL,
`state` int(10) DEFAULT '1',
`order` int(10) DEFAULT '0'
);
INSERT INTO `typecho_links_upgrade` (`lid`, `name`, `url`, `sort`, `email`, `image`, `description`, `user`, `state`, `order`)
SELECT `lid`, `name`, `url`, NULL, NULL, NULL, `description`, NULL, NULL, `order` FROM `typecho_links`;
DROP TABLE `typecho_links`;
CREATE TABLE `typecho_links` (
`lid` INTEGER NOT NULL PRIMARY KEY,
`name` varchar(50) DEFAULT NULL,
`url` varchar(200) DEFAULT NULL,
`sort` varchar(50) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`image` varchar(200) DEFAULT NULL,
`description` varchar(200) DEFAULT NULL,
`user` varchar(200) DEFAULT NULL,
`state` int(10) DEFAULT '1',
`order` int(10) DEFAULT '0'
);
INSERT INTO `typecho_links` SELECT * FROM `typecho_links_upgrade`;
DROP TABLE `typecho_links_upgrade`;