mirror of
				https://github.com/usememos/memos.git
				synced 2025-11-01 01:06:04 +08:00 
			
		
		
		
	chore: update migration scripts
This commit is contained in:
		
							parent
							
								
									fa34a7af4b
								
							
						
					
					
						commit
						c50f4f4cb4
					
				
					 4 changed files with 29 additions and 2 deletions
				
			
		|  | @ -9,10 +9,10 @@ import ( | |||
| 
 | ||||
| // Version is the service current released version. | ||||
| // Semantic versioning: https://semver.org/ | ||||
| var Version = "0.17.1" | ||||
| var Version = "0.18.0" | ||||
| 
 | ||||
| // DevVersion is the service current development version. | ||||
| var DevVersion = "0.17.1" | ||||
| var DevVersion = "0.18.0" | ||||
| 
 | ||||
| func GetCurrentVersion(mode string) string { | ||||
| 	if mode == "dev" || mode == "demo" { | ||||
|  |  | |||
|  | @ -12,6 +12,7 @@ DROP TABLE IF EXISTS `activity`; | |||
| DROP TABLE IF EXISTS `storage`; | ||||
| DROP TABLE IF EXISTS `idp`; | ||||
| DROP TABLE IF EXISTS `inbox`; | ||||
| DROP TABLE IF EXISTS `webhook`; | ||||
| 
 | ||||
| -- migration_history | ||||
| CREATE TABLE `migration_history` ( | ||||
|  | @ -133,3 +134,14 @@ CREATE TABLE `inbox` ( | |||
|   `status` TEXT NOT NULL, | ||||
|   `message` TEXT NOT NULL | ||||
| ); | ||||
| 
 | ||||
| -- webhook | ||||
| CREATE TABLE `webhook` ( | ||||
|   `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||||
|   `created_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||||
|   `updated_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||||
|   `row_status` VARCHAR(256) NOT NULL DEFAULT 'NORMAL', | ||||
|   `creator_id` INT NOT NULL, | ||||
|   `name` TEXT NOT NULL, | ||||
|   `url` TEXT NOT NULL | ||||
| ); | ||||
|  |  | |||
|  | @ -12,6 +12,7 @@ DROP TABLE IF EXISTS activity; | |||
| DROP TABLE IF EXISTS storage; | ||||
| DROP TABLE IF EXISTS idp; | ||||
| DROP TABLE IF EXISTS inbox; | ||||
| DROP TABLE IF EXISTS webhook; | ||||
| 
 | ||||
| -- migration_history | ||||
| CREATE TABLE migration_history ( | ||||
|  |  | |||
|  | @ -12,6 +12,7 @@ DROP TABLE IF EXISTS activity; | |||
| DROP TABLE IF EXISTS storage; | ||||
| DROP TABLE IF EXISTS idp; | ||||
| DROP TABLE IF EXISTS inbox; | ||||
| DROP TABLE IF EXISTS webhook; | ||||
| 
 | ||||
| -- migration_history | ||||
| CREATE TABLE migration_history ( | ||||
|  | @ -144,3 +145,16 @@ CREATE TABLE inbox ( | |||
|   status TEXT NOT NULL, | ||||
|   message TEXT NOT NULL DEFAULT '{}' | ||||
| ); | ||||
| 
 | ||||
| -- webhook | ||||
| CREATE TABLE webhook ( | ||||
|   id INTEGER PRIMARY KEY AUTOINCREMENT, | ||||
|   created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), | ||||
|   updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), | ||||
|   row_status TEXT NOT NULL CHECK (row_status IN ('NORMAL', 'ARCHIVED')) DEFAULT 'NORMAL', | ||||
|   creator_id INTEGER NOT NULL, | ||||
|   name TEXT NOT NULL, | ||||
|   url TEXT NOT NULL | ||||
| ); | ||||
| 
 | ||||
| CREATE INDEX idx_webhook_creator_id ON webhook (creator_id); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue