chore: update migration scripts

pull/2601/head
Steven 1 year ago
parent fa34a7af4b
commit c50f4f4cb4

@ -9,10 +9,10 @@ import (
// Version is the service current released version. // Version is the service current released version.
// Semantic versioning: https://semver.org/ // Semantic versioning: https://semver.org/
var Version = "0.17.1" var Version = "0.18.0"
// DevVersion is the service current development version. // DevVersion is the service current development version.
var DevVersion = "0.17.1" var DevVersion = "0.18.0"
func GetCurrentVersion(mode string) string { func GetCurrentVersion(mode string) string {
if mode == "dev" || mode == "demo" { if mode == "dev" || mode == "demo" {

@ -12,6 +12,7 @@ DROP TABLE IF EXISTS `activity`;
DROP TABLE IF EXISTS `storage`; DROP TABLE IF EXISTS `storage`;
DROP TABLE IF EXISTS `idp`; DROP TABLE IF EXISTS `idp`;
DROP TABLE IF EXISTS `inbox`; DROP TABLE IF EXISTS `inbox`;
DROP TABLE IF EXISTS `webhook`;
-- migration_history -- migration_history
CREATE TABLE `migration_history` ( CREATE TABLE `migration_history` (
@ -133,3 +134,14 @@ CREATE TABLE `inbox` (
`status` TEXT NOT NULL, `status` TEXT NOT NULL,
`message` 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 storage;
DROP TABLE IF EXISTS idp; DROP TABLE IF EXISTS idp;
DROP TABLE IF EXISTS inbox; DROP TABLE IF EXISTS inbox;
DROP TABLE IF EXISTS webhook;
-- migration_history -- migration_history
CREATE TABLE migration_history ( CREATE TABLE migration_history (

@ -12,6 +12,7 @@ DROP TABLE IF EXISTS activity;
DROP TABLE IF EXISTS storage; DROP TABLE IF EXISTS storage;
DROP TABLE IF EXISTS idp; DROP TABLE IF EXISTS idp;
DROP TABLE IF EXISTS inbox; DROP TABLE IF EXISTS inbox;
DROP TABLE IF EXISTS webhook;
-- migration_history -- migration_history
CREATE TABLE migration_history ( CREATE TABLE migration_history (
@ -144,3 +145,16 @@ CREATE TABLE inbox (
status TEXT NOT NULL, status TEXT NOT NULL,
message TEXT NOT NULL DEFAULT '{}' 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…
Cancel
Save