using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace esuite.Database.SqlServer.Migrations
{
    /// <inheritdoc />
    public partial class AddLastUpdateColumn : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Domain",
                table: "UserRoles",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "UserManager",
                table: "SsoProviders",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Printer",
                table: "Specifications",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Printer",
                table: "Sites",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Printer",
                table: "SiteContacts",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Sequences",
                table: "Sequences",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Domain",
                table: "Roles",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Domain",
                table: "RoleAccess",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Printer",
                table: "Organisations",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Printer",
                table: "OrganisationContacts",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Mail",
                table: "MailTemplates",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Glossaries",
                table: "GlossaryCustomFieldValues",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Glossaries",
                table: "GlossaryCustomFields",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Glossaries",
                table: "Glossaries",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Forms",
                table: "FormTemplateVersions",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Forms",
                table: "FormTemplates",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Forms",
                table: "FormInstances",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Forms",
                table: "FormFieldInstances",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Domain",
                table: "Domains",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldTexts",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldSequences",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFields",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldNumbers",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldGlossaries",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldFormTemplates",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "LastUpdated",
                schema: "Contacts",
                table: "Contacts",
                type: "datetimeoffset",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "CustomFields",
                table: "CustomFields",
                keyColumn: "Id",
                keyValue: 1L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Domain",
                table: "Domains",
                keyColumn: "Id",
                keyValue: 1L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Glossaries",
                table: "Glossaries",
                keyColumn: "Id",
                keyValue: 1L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Glossaries",
                table: "Glossaries",
                keyColumn: "Id",
                keyValue: 2L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Glossaries",
                table: "Glossaries",
                keyColumn: "Id",
                keyValue: 3L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Glossaries",
                table: "GlossaryCustomFields",
                keyColumn: "Id",
                keyValue: 1L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Mail",
                table: "MailTemplates",
                keyColumn: "Id",
                keyValue: 1L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Mail",
                table: "MailTemplates",
                keyColumn: "Id",
                keyValue: 2L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Mail",
                table: "MailTemplates",
                keyColumn: "Id",
                keyValue: 3L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Mail",
                table: "MailTemplates",
                keyColumn: "Id",
                keyValue: 4L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Domain",
                table: "Roles",
                keyColumn: "Id",
                keyValue: 1L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Domain",
                table: "Roles",
                keyColumn: "Id",
                keyValue: 2L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));

            migrationBuilder.UpdateData(
                schema: "Domain",
                table: "UserRoles",
                keyColumn: "Id",
                keyValue: 1L,
                column: "LastUpdated",
                value: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)));
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Domain",
                table: "UserRoles");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "UserManager",
                table: "SsoProviders");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Printer",
                table: "Specifications");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Printer",
                table: "Sites");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Printer",
                table: "SiteContacts");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Sequences",
                table: "Sequences");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Domain",
                table: "Roles");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Domain",
                table: "RoleAccess");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Printer",
                table: "Organisations");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Printer",
                table: "OrganisationContacts");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Mail",
                table: "MailTemplates");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Glossaries",
                table: "GlossaryCustomFieldValues");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Glossaries",
                table: "GlossaryCustomFields");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Glossaries",
                table: "Glossaries");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Forms",
                table: "FormTemplateVersions");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Forms",
                table: "FormTemplates");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Forms",
                table: "FormInstances");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Forms",
                table: "FormFieldInstances");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Domain",
                table: "Domains");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldTexts");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldSequences");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFields");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldNumbers");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldGlossaries");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "CustomFields",
                table: "CustomFieldFormTemplates");

            migrationBuilder.DropColumn(
                name: "LastUpdated",
                schema: "Contacts",
                table: "Contacts");
        }
    }
}
