diff --git a/dal/db_query/queries.sql b/dal/db_query/queries.sql index c370d80..d093792 100644 --- a/dal/db_query/queries.sql +++ b/dal/db_query/queries.sql @@ -1553,4 +1553,4 @@ update YclientsTokens set Expiration=$1, Active = $2 where AccountID = $3 RETURN select * from YclientsTokens where AccountID = $1 and Expiration=false and Active = true; -- name: CreateYclientsAccount :one -insert into YclientsAccounts (AccountID,SalonID,Title,Country,ShortDecription,Active) values ($1,$2,$3,$4,$5,$6) RETURNING *; \ No newline at end of file +insert into YclientsAccounts (AccountID,SalonID,Title,Country,ShortDecription) values ($1,$2,$3,$4,$5) RETURNING *; \ No newline at end of file diff --git a/dal/schema/000028_init.up.sql b/dal/schema/000028_init.up.sql index ea497c6..b24cca2 100644 --- a/dal/schema/000028_init.up.sql +++ b/dal/schema/000028_init.up.sql @@ -15,7 +15,6 @@ CREATE TABLE IF NOT EXISTS YclientsAccounts ( SalonID INT NOT NULL, -- ID компании Title text NOT NULL DEFAULT '', ShortDecription text NOT NULL DEFAULT '', - Active INT NOT NULL, Country VARCHAR(50) NOT NULL DEFAULT '', Deleted BOOLEAN NOT NULL DEFAULT FALSE, CreatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP diff --git a/dal/sqlcgen/models.go b/dal/sqlcgen/models.go index 2b7ef75..0b94644 100644 --- a/dal/sqlcgen/models.go +++ b/dal/sqlcgen/models.go @@ -405,7 +405,6 @@ type Yclientsaccount struct { Salonid int32 `db:"salonid" json:"salonid"` Title string `db:"title" json:"title"` Shortdecription string `db:"shortdecription" json:"shortdecription"` - Active int32 `db:"active" json:"active"` Country string `db:"country" json:"country"` Deleted bool `db:"deleted" json:"deleted"` Createdat time.Time `db:"createdat" json:"createdat"` diff --git a/dal/sqlcgen/queries.sql.go b/dal/sqlcgen/queries.sql.go index 9ef90a5..8771c23 100644 --- a/dal/sqlcgen/queries.sql.go +++ b/dal/sqlcgen/queries.sql.go @@ -1265,7 +1265,7 @@ func (q *Queries) CreateWebHook(ctx context.Context, arg CreateWebHookParams) er } const createYclientsAccount = `-- name: CreateYclientsAccount :one -insert into YclientsAccounts (AccountID,SalonID,Title,Country,ShortDecription,Active) values ($1,$2,$3,$4,$5,$6) RETURNING id, accountid, salonid, title, shortdecription, active, country, deleted, createdat +insert into YclientsAccounts (AccountID,SalonID,Title,Country,ShortDecription) values ($1,$2,$3,$4,$5) RETURNING id, accountid, salonid, title, shortdecription, country, deleted, createdat ` type CreateYclientsAccountParams struct { @@ -1274,7 +1274,6 @@ type CreateYclientsAccountParams struct { Title string `db:"title" json:"title"` Country string `db:"country" json:"country"` Shortdecription string `db:"shortdecription" json:"shortdecription"` - Active int32 `db:"active" json:"active"` } func (q *Queries) CreateYclientsAccount(ctx context.Context, arg CreateYclientsAccountParams) (Yclientsaccount, error) { @@ -1284,7 +1283,6 @@ func (q *Queries) CreateYclientsAccount(ctx context.Context, arg CreateYclientsA arg.Title, arg.Country, arg.Shortdecription, - arg.Active, ) var i Yclientsaccount err := row.Scan( @@ -1293,7 +1291,6 @@ func (q *Queries) CreateYclientsAccount(ctx context.Context, arg CreateYclientsA &i.Salonid, &i.Title, &i.Shortdecription, - &i.Active, &i.Country, &i.Deleted, &i.Createdat, @@ -2461,7 +2458,7 @@ func (q *Queries) GetCurrentCompany(ctx context.Context, accountid string) (Acco const getCurrentYclientsCompany = `-- name: GetCurrentYclientsCompany :one -SELECT id, accountid, salonid, title, shortdecription, active, country, deleted, createdat FROM YclientsAccounts WHERE AccountID = $1 AND Deleted = false +SELECT id, accountid, salonid, title, shortdecription, country, deleted, createdat FROM YclientsAccounts WHERE AccountID = $1 AND Deleted = false ` // Yclients @@ -2474,7 +2471,6 @@ func (q *Queries) GetCurrentYclientsCompany(ctx context.Context, accountid strin &i.Salonid, &i.Title, &i.Shortdecription, - &i.Active, &i.Country, &i.Deleted, &i.Createdat, diff --git a/model/yclients.go b/model/yclients.go index 33e46ff..c19c71c 100644 --- a/model/yclients.go +++ b/model/yclients.go @@ -17,7 +17,6 @@ type YclientsAccount struct { SalonID int32 `json:"salon_id"` // ID "аккаунта который ГЛАВНЫЙ" Title string `json:"title"` ShortDecription string `json:"shortDecription"` - Active int32 `json:"active"` Country string `json:"country"` Deleted bool `json:"deleted"` CreatedAt time.Time `json:"createdAt"` diff --git a/repository/yclients/yclients.go b/repository/yclients/yclients.go index 2464459..90b8dfe 100644 --- a/repository/yclients/yclients.go +++ b/repository/yclients/yclients.go @@ -109,7 +109,6 @@ func (r *YclientsRepository) GetCurrentAccount(ctx context.Context, accountID st Title: row.Title, Country: row.Country, ShortDecription: row.Shortdecription, - Active: row.Active, Deleted: row.Deleted, CreatedAt: row.Createdat, } @@ -175,7 +174,6 @@ func (r *YclientsRepository) CreateAccount(ctx context.Context, account model.Yc Title: account.Title, Country: account.Country, Shortdecription: account.ShortDecription, - Active: account.Active, }) if err != nil { return nil, err @@ -188,7 +186,6 @@ func (r *YclientsRepository) CreateAccount(ctx context.Context, account model.Yc Title: row.Title, Country: row.Country, ShortDecription: row.Shortdecription, - Active: row.Active, Deleted: row.Deleted, CreatedAt: row.Createdat, }, nil