using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Email.Data.Migrations { /// public partial class InitialSchema : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: "email"); migrationBuilder.CreateTable( name: "Templates", schema: "email", columns: table => new { Key = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Language = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), Value = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false, defaultValue: ""), UpdatedAt = table.Column(type: "datetime2", nullable: false, defaultValueSql: "SYSUTCDATETIME()"), OperatorCopy = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false, defaultValue: "") }, constraints: table => { table.PrimaryKey("PK_Templates", x => new { x.Key, x.Language }); }); // Seed email templates with a single comprehensive SQL batch migrationBuilder.Sql(@" INSERT INTO [email].Templates ([Key], [Language], [Value], [Description]) VALUES ('email.match.subject', 'en', 'MyAi.ro CV Match: {{score}}% - {{jobLabel}}', 'Subject for the CV match result email'), ('email.match.subject', 'ro', 'MyAi.ro Potrivire CV: {{score}}% - {{jobLabel}}', 'Subiect email rezultat potrivire CV'), ('email.search-results.subject', 'en', 'MyAi.ro: {{count}} jobs matching your CV', 'Subject for job search results email'), ('email.search-results.subject', 'ro', 'MyAi.ro: {{count}} joburi potrivite CV-ului tau', 'Subiect email rezultate cautare joburi'), ('html.job-search.started.title', 'en', 'Job search started', 'Title for job search started page'), ('html.job-search.started.title', 'ro', 'Căutare joburi pornită', 'Titlu pagina cautare joburi pornita'), ('html.job-search.already-used.title', 'en', 'Link already used', 'Title for already-used page'), ('html.job-search.already-used.title', 'ro', 'Link deja folosit', 'Titlu pagina link deja folosit'), ('html.job-search.expired.title', 'en', 'Link expired', 'Title for expired link page'), ('html.job-search.expired.title', 'ro', 'Link expirat', 'Titlu pagina link expirat'), ('html.job-search.invalid.title', 'en', 'Invalid link', 'Title for invalid link page'), ('html.job-search.invalid.title', 'ro', 'Link invalid', 'Titlu pagina link invalid'), ('html.job-search.error.title', 'en', 'Error', 'Title for error page'), ('html.job-search.error.title', 'ro', 'Eroare', 'Titlu pagina eroare'); "); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Templates", schema: "email"); } } }