add migrate schema for lead target

This commit is contained in:
Pavel 2024-06-10 18:56:25 +03:00
parent 4b0f100655
commit 0b725ece22
4 changed files with 25 additions and 0 deletions

@ -0,0 +1,2 @@
ALTER TABLE account ADD column email varchar(50) NOT NULL default '';
DROP TABLE IF EXISTS leadtarget;

@ -0,0 +1,11 @@
AlTER TABLE account DROP column email;
CREATE TABLE IF NOT EXISTS leadtarget(
ID BIGSERIAL UNIQUE NOT NULL PRIMARY KEY,
AccountID varchar(30) NOT NULL,
Type varchar(50) NOT NULL,
QuizID integer NOT NULL DEFAULT 0,
Target text NOT NULL,
Deleted boolean NOT NULL DEFAULT false,
CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)

@ -308,3 +308,13 @@ type AnswerExport struct {
}
type UTMSavingMap map[string]string
type LeadTarget struct {
ID int64 `json:"id"`
AccountID string `json:"accountID"`
Type string `json:"type"`
QuizID int32 `json:"quizID"`
Target string `json:"target"`
Deleted bool `json:"deleted"`
CreatedAt time.Time `json:"createdAt"`
}

@ -30,6 +30,8 @@ packages:
- "./dal/schema/000012_init.down.sql"
- "./dal/schema/000013_init.up.sql"
- "./dal/schema/000013_init.down.sql"
- "./dal/schema/000014_init.up.sql"
- "./dal/schema/000014_init.down.sql"
engine: "postgresql"
emit_json_tags: true
emit_db_tags: true