This commit is contained in:
seb
2026-07-31 04:48:13 +02:00
parent fdd9e684d8
commit 10d1d472fd
6 changed files with 1035 additions and 959 deletions

View File

@@ -22,7 +22,9 @@ BEGIN
id INT IDENTITY(1,1) PRIMARY KEY,
email NVARCHAR(320) NOT NULL,
created_at DATETIME2 NOT NULL CONSTRAINT DF_google_auth_created_at DEFAULT SYSUTCDATETIME(),
CONSTRAINT UQ_google_auth_email UNIQUE (email)
selected_company INT NULL,
CONSTRAINT UQ_google_auth_email UNIQUE (email),
CONSTRAINT FK_google_auth_selected_company FOREIGN KEY (selected_company) REFERENCES company(id) ON DELETE SET NULL
);
END
`;
@@ -501,12 +503,12 @@ END
/** DDL scripts in dependency order for schema init. */
export const SCHEMA_SCRIPTS = [
INIT_META,
INIT_GOOGLE_AUTH,
INIT_LANGUAGE,
INIT_TAX,
INIT_CATEGORY,
INIT_PIC,
INIT_COMPANY,
INIT_GOOGLE_AUTH,
INIT_CUSTOMERGROUP,
INIT_ENTITY,
INIT_UNIT,

View File

@@ -5,7 +5,7 @@ VALUES (@email)
`;
export const LIST = `
SELECT id, email, created_at
SELECT id, email, created_at, selected_company
FROM google_auth
ORDER BY id
`;

View File

@@ -23,12 +23,12 @@ export const TABLES = [
'unit',
'entity',
'customergroup',
'google_auth',
'company',
'pic',
'category',
'tax',
'language',
'google_auth',
'meta',
];