visuddhinanda 4 лет назад
Родитель
Сommit
2967436e74

+ 6 - 0
db/postgresql/migrations/2021-11-28-010432_bold/down.sql

@@ -0,0 +1,6 @@
+
+DROP INDEX IF EXISTS bold_bookpara ;
+DROP INDEX IF EXISTS bold_word ;
+DROP INDEX IF EXISTS bold_word_en ;
+
+DROP TABLE bold;

+ 23 - 0
db/postgresql/migrations/2021-11-28-010432_bold/up.sql

@@ -0,0 +1,23 @@
+--
+-- 由SQLiteStudio v3.1.1 产生的文件 周日 11月 21 21:37:23 2021
+--
+-- 文本编码:UTF-8
+--
+
+-- 表:bold
+CREATE TABLE bold (
+    id SERIAL PRIMARY KEY,
+    book      INTEGER NOT NULL,
+    paragraph INTEGER NOT NULL,
+    word      TEXT    NOT NULL,
+    word2     TEXT    NOT NULL,
+    word_en   TEXT,
+    pali      TEXT,
+    base      TEXT,
+	created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+CREATE INDEX bold_bookpara ON bold (book,paragraph);
+CREATE INDEX bold_word ON bold (word);
+CREATE INDEX bold_word_en ON bold (word_en);
+

+ 4 - 0
db/postgresql/migrations/2021-11-28-010623_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/postgresql/migrations/2021-11-28-010623_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);
+

+ 3 - 0
db/postgresql/migrations/2021-11-28-010830_pali_sent/down.sql

@@ -0,0 +1,3 @@
+
+DROP INDEX  IF EXISTS  palisentId ;
+DROP TABLE pali_sent ;

+ 20 - 0
db/postgresql/migrations/2021-11-28-010830_pali_sent/up.sql

@@ -0,0 +1,20 @@
+-- 表:pali_sent
+CREATE TABLE pali_sent (
+    id SERIAL PRIMARY KEY,
+    book      INTEGER,
+    paragraph INTEGER,
+    word_begin   INTEGER,
+    word_end     INTEGER,
+    length    INTEGER,
+    count     INTEGER,
+    text      TEXT,
+    html      TEXT,
+    sim_sents TEXT,
+    sim_sents_count INTEGER NOT NULL DEFAULT (0),
+    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+-- 索引:sentId
+CREATE INDEX palisentId ON pali_sent (book, paragraph, word_begin, word_end);
+

+ 3 - 0
db/postgresql/migrations/2021-11-28-011002_pali_sent_org/down.sql

@@ -0,0 +1,3 @@
+
+DROP INDEX  IF EXISTS  pali_sent_org_uid ;
+DROP TABLE pali_sent_org ;

+ 21 - 0
db/postgresql/migrations/2021-11-28-011002_pali_sent_org/up.sql

@@ -0,0 +1,21 @@
+-- 表:pali_sent
+CREATE TABLE pali_sent_org (
+    id SERIAL PRIMARY KEY,
+    book      INTEGER,
+    paragraph INTEGER,
+    word_begin   INTEGER,
+    word_end     INTEGER,
+    length    INTEGER,
+    count     INTEGER,
+    text      TEXT,
+    html      TEXT,
+	cell      INTEGER NOT NULL DEFAULT (1),
+    sim_sents TEXT,
+    sim_sents_count INTEGER NOT NULL DEFAULT (0),
+    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+-- 索引:sentId
+CREATE INDEX pali_sent_org_uid ON pali_sent_org (book, paragraph, word_begin, word_end);
+

+ 2 - 0
db/postgresql/migrations/2021-11-28-011108_pali_sent_index/down.sql

@@ -0,0 +1,2 @@
+DROP INDEX  IF EXISTS  pali_sent_index_book ;
+DROP TABLE pali_sent_index ;

+ 11 - 0
db/postgresql/migrations/2021-11-28-011108_pali_sent_index/up.sql

@@ -0,0 +1,11 @@
+
+-- 表:pali_sent_index
+CREATE TABLE pali_sent_index (
+	id SERIAL PRIMARY KEY,
+    book   INTEGER,
+    para   INTEGER,
+    strlen INTEGER,
+    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+CREATE INDEX pali_sent_index_book ON pali_sent_index (book, para);

+ 3 - 0
db/postgresql/migrations/2021-11-28-011305_sent_sim/down.sql

@@ -0,0 +1,3 @@
+
+DROP INDEX  IF EXISTS  sent_sim_sent1 ;
+DROP TABLE sent_sim ;

+ 14 - 0
db/postgresql/migrations/2021-11-28-011305_sent_sim/up.sql

@@ -0,0 +1,14 @@
+
+-- 表:sent_sim
+CREATE TABLE sent_sim 
+(
+    id SERIAL PRIMARY KEY,
+	sent1 INTEGER, 
+	sent2 INTEGER, 
+	sim REAL,
+    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+
+-- 索引:sent
+CREATE INDEX sent_sim_sent1 ON sent_sim (sent1);
+

+ 2 - 0
db/postgresql/migrations/2021-11-28-011427_sent_sim_index/down.sql

@@ -0,0 +1,2 @@
+
+DROP TABLE sent_sim_index ;

+ 10 - 0
db/postgresql/migrations/2021-11-28-011427_sent_sim_index/up.sql

@@ -0,0 +1,10 @@
+
+-- 表:sent_sim_index
+CREATE TABLE sent_sim_index 
+(
+    id SERIAL PRIMARY KEY,
+	sent_id INTEGER,
+	count INTEGER,
+    created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+

+ 1 - 0
db/postgresql/migrations/2021-11-28-011657_progress/down.sql

@@ -0,0 +1 @@
+DROP TABLE progress ;

+ 12 - 0
db/postgresql/migrations/2021-11-28-011657_progress/up.sql

@@ -0,0 +1,12 @@
+-- 表:progress
+CREATE TABLE progress 
+(
+	id SERIAL PRIMARY KEY,
+	book INTEGER, 
+	para INTEGER, 
+	lang VARCHAR (16), 
+	all_strlen INTEGER, 
+	public_strlen INTEGER,
+	created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+

+ 1 - 0
db/postgresql/migrations/2021-11-28-011747_progress_chapter/down.sql

@@ -0,0 +1 @@
+DROP TABLE progress_chapter ;

+ 13 - 0
db/postgresql/migrations/2021-11-28-011747_progress_chapter/up.sql

@@ -0,0 +1,13 @@
+
+-- 表:progress_chapter
+CREATE TABLE progress_chapter 
+(
+	id SERIAL PRIMARY KEY,
+	book INTEGER, 
+	para INTEGER, 
+	lang VARCHAR (16), 
+	all_trans REAL, 
+	public REAL,
+	created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+);
+