-- MSSQL Database Initialization Script
-- This script runs automatically when the container starts

IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = 'lcc')
BEGIN
    CREATE DATABASE lcc;
    PRINT 'Database lcc created successfully';
END
ELSE
BEGIN
    PRINT 'Database lcc already exists';
END
GO

USE lcc;
GO

-- Optional: Create login/user if needed (for non-sa access)
-- IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = 'lcc_user')
-- BEGIN
--     CREATE LOGIN lcc_user WITH PASSWORD = 'YourStrong@Passw0rd123';
--     CREATE USER lcc_user FOR LOGIN lcc_user;
--     ALTER ROLE db_owner ADD MEMBER lcc_user;
-- END
-- GO
