refactor(chalice): changed default scope state

This commit is contained in:
Taha Yassine Kraiem 2025-05-19 15:17:54 +02:00 committed by Kraiem Taha Yassine
parent 3597523a04
commit 6f0deb57da
6 changed files with 8 additions and 4 deletions

View file

@ -87,7 +87,7 @@ async def create_tenant(data: schemas.UserSignupSchema):
"spotRefreshToken": r.pop("spotRefreshToken"), "spotRefreshToken": r.pop("spotRefreshToken"),
"spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"), "spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"),
'data': { 'data': {
"scopeState": 0, "scopeState": 2,
"user": r "user": r
} }
} }

View file

@ -98,7 +98,7 @@ async def create_tenant(data: schemas.UserSignupSchema):
"spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"), "spotRefreshTokenMaxAge": r.pop("spotRefreshTokenMaxAge"),
"tenantId": t["tenant_id"], "tenantId": t["tenant_id"],
'data': { 'data': {
"scopeState": 0, "scopeState": 2,
"user": r "user": r
} }
} }

View file

@ -20,6 +20,8 @@ $fn_def$, :'next_version')
-- --
DROP SCHEMA IF EXISTS or_cache CASCADE; DROP SCHEMA IF EXISTS or_cache CASCADE;
ALTER TABLE public.tenants
ALTER COLUMN scope_state SET DEFAULT 2;
COMMIT; COMMIT;

View file

@ -104,7 +104,7 @@ CREATE TABLE public.tenants
t_users integer NOT NULL DEFAULT 1, t_users integer NOT NULL DEFAULT 1,
t_integrations integer NOT NULL DEFAULT 0, t_integrations integer NOT NULL DEFAULT 0,
last_telemetry bigint NOT NULL DEFAULT CAST(EXTRACT(epoch FROM date_trunc('day', now())) * 1000 AS BIGINT), last_telemetry bigint NOT NULL DEFAULT CAST(EXTRACT(epoch FROM date_trunc('day', now())) * 1000 AS BIGINT),
scope_state smallint NOT NULL DEFAULT 0 scope_state smallint NOT NULL DEFAULT 2
); );

View file

@ -20,6 +20,8 @@ $fn_def$, :'next_version')
-- --
DROP SCHEMA IF EXISTS or_cache CASCADE; DROP SCHEMA IF EXISTS or_cache CASCADE;
ALTER TABLE public.tenants
ALTER COLUMN scope_state SET DEFAULT 2;
COMMIT; COMMIT;

View file

@ -103,7 +103,7 @@ CREATE TABLE public.tenants
t_users integer NOT NULL DEFAULT 1, t_users integer NOT NULL DEFAULT 1,
t_integrations integer NOT NULL DEFAULT 0, t_integrations integer NOT NULL DEFAULT 0,
last_telemetry bigint NOT NULL DEFAULT CAST(EXTRACT(epoch FROM date_trunc('day', now())) * 1000 AS BIGINT), last_telemetry bigint NOT NULL DEFAULT CAST(EXTRACT(epoch FROM date_trunc('day', now())) * 1000 AS BIGINT),
scope_state smallint NOT NULL DEFAULT 0, scope_state smallint NOT NULL DEFAULT 2,
CONSTRAINT onerow_uni CHECK (tenant_id = 1) CONSTRAINT onerow_uni CHECK (tenant_id = 1)
); );