fix dirty merge
This commit is contained in:
parent
7519f43ba3
commit
c92611e280
26
dal/schema/000030_init.down.sql
Normal file
26
dal/schema/000030_init.down.sql
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
CREATE TABLE IF NOT EXISTS YclientsTokens (
|
||||||
|
AccountID VARCHAR(30) PRIMARY KEY,
|
||||||
|
SalonID int not null, -- ID компании
|
||||||
|
AccessToken TEXT NOT NULL DEFAULT '',
|
||||||
|
Active BOOLEAN NOT NULL DEFAULT FALSE,
|
||||||
|
Expiration BOOLEAN NOT NULL DEFAULT FALSE, -- флаг истек ли токен
|
||||||
|
CreatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
create UNIQUE INDEX idx_unique_tokens_yclients ON YclientsTokens (SalonID, AccountID) WHERE Active = true and Expiration = false;
|
||||||
|
|
||||||
|
ALTER TABLE YclientsAccounts
|
||||||
|
ADD COLUMN IF NOT EXISTS ShortDecription text NOT NULL DEFAULT '',
|
||||||
|
ADD COLUMN IF NOT EXISTS Country VARCHAR(50) NOT NULL DEFAULT '';
|
||||||
|
|
||||||
|
ALTER TABLE YclientsTimeSlots
|
||||||
|
ALTER COLUMN DatesSettings SET DEFAULT '{}'::jsonb;
|
||||||
|
|
||||||
|
UPDATE YclientsTimeSlots
|
||||||
|
SET DatesSettings = '{}'::jsonb
|
||||||
|
WHERE DatesSettings = '[]'::jsonb;
|
||||||
|
|
||||||
|
ALTER TABLE YclientsServices
|
||||||
|
ALTER COLUMN PriceMin TYPE TEXT,
|
||||||
|
ALTER COLUMN PriceMax TYPE TEXT,
|
||||||
|
ALTER COLUMN Discount TYPE TEXT;
|
||||||
18
dal/schema/000030_init.up.sql
Normal file
18
dal/schema/000030_init.up.sql
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
DROP INDEX if EXISTS idx_unique_tokens_yclients;
|
||||||
|
DROP TABLE IF EXISTS YclientsTokens;
|
||||||
|
|
||||||
|
ALTER TABLE YclientsAccounts
|
||||||
|
DROP COLUMN IF EXISTS ShortDecription,
|
||||||
|
DROP COLUMN IF EXISTS Country;
|
||||||
|
|
||||||
|
ALTER TABLE YclientsTimeSlots
|
||||||
|
ALTER COLUMN DatesSettings SET DEFAULT '[]'::jsonb;
|
||||||
|
|
||||||
|
UPDATE YclientsTimeSlots
|
||||||
|
SET DatesSettings = '[]'::jsonb
|
||||||
|
WHERE DatesSettings = '{}'::jsonb;
|
||||||
|
|
||||||
|
ALTER TABLE YclientsServices
|
||||||
|
ALTER COLUMN PriceMin TYPE FLOAT USING NULLIF(PriceMin, '')::FLOAT,
|
||||||
|
ALTER COLUMN PriceMax TYPE FLOAT USING NULLIF(PriceMax, '')::FLOAT,
|
||||||
|
ALTER COLUMN Discount TYPE INT USING NULLIF(Discount, '')::INT;
|
||||||
Loading…
Reference in New Issue
Block a user