-- Create the database
IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = 'st-database')
BEGIN
    CREATE DATABASE [st-database]
END
GO

USE [st-database]
GO

-- Create schemas (excluding dbo since it already exists)
DECLARE @SQL nvarchar(max)

IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'fp')
BEGIN
    SET @SQL = 'CREATE SCHEMA fp AUTHORIZATION dbo'
    EXEC sp_executesql @SQL
    PRINT 'Created schema fp'
END

IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'fw')
BEGIN
    SET @SQL = 'CREATE SCHEMA fw AUTHORIZATION dbo'
    EXEC sp_executesql @SQL
    PRINT 'Created schema fw'
END

IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'int')
BEGIN
    SET @SQL = 'CREATE SCHEMA int AUTHORIZATION dbo'
    EXEC sp_executesql @SQL
    PRINT 'Created schema int'
END

IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'ob')
BEGIN
    SET @SQL = 'CREATE SCHEMA ob AUTHORIZATION dbo'
    EXEC sp_executesql @SQL
    PRINT 'Created schema ob'
END

-- Verify schemas
SELECT name FROM sys.schemas WHERE name IN ('fp', 'fw', 'int', 'ob')
GO