a bunch of stuff happened. I'll do better next commit...

This commit is contained in:
2026-10-09 08:24:28 -04:00
parent bf8ad6a858
commit 4bceed7cb9
27 changed files with 540 additions and 112 deletions
+22
View File
@@ -0,0 +1,22 @@
-- Run once against the decauthy database. No users receive access automatically.
CREATE TABLE IF NOT EXISTS applications (
application_serial BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
application_code VARCHAR(64) NOT NULL UNIQUE,
application_name VARCHAR(128) NOT NULL,
application_description VARCHAR(255) NOT NULL DEFAULT '',
application_url VARCHAR(2048) NOT NULL,
application_active BOOLEAN NOT NULL DEFAULT TRUE
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE TABLE IF NOT EXISTS user_applications (
user_serial BIGINT UNSIGNED NOT NULL,
application_serial BIGINT UNSIGNED NOT NULL,
assigned_by VARCHAR(128) NOT NULL,
assigned_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (user_serial, application_serial),
FOREIGN KEY (user_serial) REFERENCES users(user_serial) ON DELETE CASCADE,
FOREIGN KEY (application_serial) REFERENCES applications(application_serial) ON DELETE CASCADE
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
INSERT INTO applications (application_code, application_name, application_description, application_url) VALUES
('realestatedatainc', 'Real Estate Data Inc', 'Open your Real Estate Data Inc account.', 'http://ositsdevels/clients/dec-international/realestatedatainc/main.php'),
('atlhousingreport', 'Georgia Housing Report', 'Open your Georgia Housing Report account.', 'http://ositsdevels/clients/dec-international/atlhousingreport/')
ON DUPLICATE KEY UPDATE application_code = VALUES(application_code);