mirror of
https://github.com/Portabase/agent.git
synced 2026-09-10 18:16:55 +00:00
eac2853b83
* fix: tests and refactoring, add justfile instead of makefile * chore: add tiberius dependency for MSSQL support * feat: add Mssql variant to DbType enum and config validation * feat: add MSSQL domain adapter with tiberius ping and sqlpackage backup/restore * feat: install sqlpackage in Docker base and prod stages * feat: add MSSQL service to docker-compose and config examples * fix: log backup errors instead of silently discarding them * fix: use dotnet-install.sh instead of Microsoft apt feed (SHA1 key rejected by Debian Trixie) * fix: add /TrustServerCertificate:true to sqlpackage commands for self-signed certs * fix: use connection string with TrustServerCertificate for sqlpackage * fix: use user database in MSSQL config example (system databases cannot be exported) * feat: add seed-mssql task and seed script * fix: docker-compose.yml
21 lines
588 B
Transact-SQL
21 lines
588 B
Transact-SQL
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'myappdb')
|
|
CREATE DATABASE [myappdb];
|
|
GO
|
|
|
|
USE [myappdb];
|
|
GO
|
|
|
|
IF OBJECT_ID('users', 'U') IS NULL
|
|
CREATE TABLE users (
|
|
id INT IDENTITY(1,1) PRIMARY KEY,
|
|
email NVARCHAR(255) NOT NULL UNIQUE,
|
|
name NVARCHAR(255),
|
|
created_at DATETIME DEFAULT GETDATE()
|
|
);
|
|
GO
|
|
|
|
INSERT INTO users (email, name) VALUES ('alice@example.com', 'Alice');
|
|
INSERT INTO users (email, name) VALUES ('bob@example.com', 'Bob');
|
|
INSERT INTO users (email, name) VALUES ('charlie@example.com', 'Charlie');
|
|
GO
|