add migrate file for save amo contact data

This commit is contained in:
Pavel 2024-06-20 18:37:25 +03:00
parent 6d44920115
commit 0116666117
4 changed files with 17 additions and 0 deletions

@ -0,0 +1 @@
DROP TABLE IF EXISTS amoContact;

@ -0,0 +1,6 @@
CREATE TABLE IF NOT EXISTS amoContact (
ID BIGSERIAL UNIQUE NOT NULL PRIMARY KEY,
AccountID INT NOT NULL, -- ID "компании" в амо
AmoID INT NOT NULL, -- ID контакта в амо
Field text NOT NULL DEFAULT '' -- значение чего то email? phone? etc
)

@ -288,3 +288,11 @@ type AmoUsersTrueResults struct {
QuizAccountID string
DriveURL string
}
// возможно стоит добавить enum? тип ContactQuizConfig уже есть
type ContactAmo struct {
ID int64
AccountID int32 // id аккаунта в амо к которому привязан контакт
AmoID int32 // id контакта в амо
Field string // значение поля
}

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