Procházet zdrojové kódy

word_statistics 迁移

visuddhinanda před 4 roky
rodič
revize
1e9f84af8d

+ 4 - 0
db/sqlite/word_statistics/down.sql

@@ -0,0 +1,4 @@
+-- This file should undo anything in `up.sql`
+DROP INDEX IF EXISTS word_statistics_bookid ;
+DROP INDEX IF EXISTS word_statistics_base ;
+DROP TABLE word_statistics ;

+ 19 - 0
db/sqlite/word_statistics/up.sql

@@ -0,0 +1,19 @@
+-- word_statistics
+CREATE TABLE word_statistics
+(
+	id SERIAL PRIMARY KEY, 
+	bookid INTEGER, 
+	word TEXT, 
+	count INTEGER, 
+	base TEXT, 
+	end1 TEXT, 
+	end2 TEXT, 
+	type INTEGER, 
+	length INTEGER,
+	created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+-- 索引:pali
+CREATE INDEX word_statistics_bookid ON word_statistics (bookid);
+CREATE INDEX word_statistics_base ON word_statistics (base);
+