-- 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 if they don't exist
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'dbo')
    EXEC('CREATE SCHEMA [dbo]')
GO

IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'fp')
    EXEC('CREATE SCHEMA [fp]')
GO

IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'fw')
    EXEC('CREATE SCHEMA [fw]')
GO

IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'int')
    EXEC('CREATE SCHEMA [int]')
GO

IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'ob')
    EXEC('CREATE SCHEMA [ob]')
GO