Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Insert Data
- #region Insert System Application
- migrationBuilder.InsertData(
- table: "Applications",
- columns: new[]
- {
- "Id",
- "Guid",
- "CreatedAt",
- "UpdatedAt",
- "Name",
- "Description"
- },
- values: new object[]
- {
- 1,
- Constants.ApplicationSystemGuid,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- "System",
- "This is a default application to manage users"
- }
- );
- migrationBuilder.InsertData(
- table: "Forms",
- columns: new[]
- {
- "Id",
- "Guid",
- "CreatedAt",
- "UpdatedAt",
- "Name",
- "ApplicationId"
- },
- values: new object[]
- {
- 1,
- Constants.FormUsersGuid,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- "Users",
- 1
- }
- );
- migrationBuilder.InsertData(
- table: "Forms",
- columns: new[]
- {
- "Id",
- "Guid",
- "CreatedAt",
- "UpdatedAt",
- "Name",
- "ApplicationId"
- },
- values: new object[]
- {
- 2,
- Constants.FormGroupsGuid,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- "Groups",
- 1
- }
- ); migrationBuilder.InsertData(
- table: "FormViews",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "Name",
- "FormId"
- },
- values: new object[]
- {
- 1,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- "UsersView",
- 1
- }
- ); migrationBuilder.InsertData(
- table: "FormViews",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "Name",
- "FormId"
- },
- values: new object[]
- {
- 2,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- "GroupsView",
- 2
- }
- );
- migrationBuilder.InsertData(
- table: "FormAttributes",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "Guid",
- "Name",
- "FormId",
- "AttributeTypeId",
- "Column",
- "Code"
- },
- values: new object[]
- {
- 1,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- Constants.UserFirstNameGuid,
- "First Name",
- 1,
- 1,
- "Text1",
- "UserFirstName"
- }
- );
- migrationBuilder.InsertData(
- table: "FormAttributes",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "Guid",
- "Name",
- "FormId",
- "AttributeTypeId",
- "Column",
- "Code"
- },
- values: new object[]
- {
- 2,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- Constants.UserLastNameGuid,
- "Last Name",
- 1,
- 1,
- "Text2",
- "UserLastName"
- }
- );
- migrationBuilder.InsertData(
- table: "FormAttributes",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "Guid",
- "Name",
- "FormId",
- "AttributeTypeId",
- "Column",
- "Code"
- },
- values: new object[]
- {
- 3,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- Constants.GroupNameGuid,
- "Name",
- 2,
- 1,
- "Text1",
- "GroupName"
- }
- );
- migrationBuilder.InsertData(
- table: "Fields",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "FormViewId",
- "PlaceholderId",
- "FieldPosition",
- "IsRequired",
- "IsEditable",
- "IsVisible",
- "FormAttributeId"
- },
- values: new object[]
- {
- 1,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- 1,
- 0,
- 0,
- true,
- true,
- true,
- 1
- }
- );
- migrationBuilder.InsertData(
- table: "Fields",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "FormViewId",
- "PlaceholderId",
- "FieldPosition",
- "IsRequired",
- "IsEditable",
- "IsVisible",
- "FormAttributeId"
- },
- values: new object[]
- {
- 2,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- 1,
- 0,
- 1,
- true,
- true,
- true,
- 2
- }
- );
- migrationBuilder.InsertData(
- table: "Fields",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "FormViewId",
- "PlaceholderId",
- "FieldPosition",
- "IsRequired",
- "IsEditable",
- "IsVisible",
- "FormAttributeId"
- },
- values: new object[]
- {
- 3,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- 2,
- 0,
- 0,
- true,
- true,
- true,
- 3
- }
- );
- migrationBuilder.InsertData(
- table: "Signatures",
- columns: new[] { "Id", "CreatedAt", "UpdatedAt", "FormId" },
- values: new object[] { "1", new DateTime(2019, 01, 30), new DateTime(2019, 01, 30), 1 }
- );
- migrationBuilder.InsertData(
- table: "Signatures",
- columns: new[] { "Id", "CreatedAt", "UpdatedAt", "FormId" },
- values: new object[] { "2", new DateTime(2019, 01, 30), new DateTime(2019, 01, 30), 2 }
- );
- #endregion
- #region Insert Users
- migrationBuilder.InsertData(
- table: "Documents",
- columns: new[] { "Id", "CreatedAt", "UpdatedAt", "FormId", "Text1", "Text2" },
- values: new object[] { 1, new DateTime(2019, 01, 30), new DateTime(2019, 01, 30), 1, "Admin First Name", "Admin Surname" }
- );
- //username: admin
- //password: admin
- migrationBuilder.InsertData(
- table: "AspNetUsers",
- columns: new[]
- {
- "Id",
- "DocumentId",
- "UserName",
- "NormalizedUserName",
- "EmailConfirmed",
- "PasswordHash",
- "SecurityStamp",
- "ConcurrencyStamp",
- "PhoneNumber",
- "PhoneNumberConfirmed",
- "TwoFactorEnabled",
- "LockoutEnd",
- "LockoutEnabled",
- "AccessFailedCount"
- },
- values: new object[]
- {
- "0bbc790f-cf94-48b3-ae77-3cc2e15a2a9b",
- 1,
- "admin",
- "ADMIN",
- false,
- "AQAAAAEAACcQAAAAEK9jfhMVsZdoouotsMTWpJjnY46fCL6cbWMhArAYy3ONrOQRbxHvDXl+Y8R+Hm1fQQ==",
- "P4EBTGKUNSAFJLYUUPOTPWPDLZWF6DJA",
- "342eea67-c72f-4332-9930-dd9c2662f89b",
- null,
- false,
- false,
- null,
- true,
- 0
- }
- );
- #endregion
- #region Insert Language
- // Insert Default Language Attribut to System Application
- migrationBuilder.InsertData(
- table: "Dictionaries",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "IsGlobal"
- },
- values: new object[]
- {
- 1,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- false
- }
- );
- migrationBuilder.InsertData(
- table: "DictionaryItems",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "Value",
- "DictionaryId"
- },
- values: new object[]
- {
- 1,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- "Polski",
- 1
- }
- );
- migrationBuilder.InsertData(
- table: "FormAttributes",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "Guid",
- "Name",
- "FormId",
- "AttributeTypeId",
- "Column",
- "Configuration",
- "Code"
- },
- values: new object[]
- {
- 4,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- Constants.UserDefaultLanguageGuid,
- "Default Language",
- 1,
- 6,
- "DropdownList1",
- "{\"dictionaryId\":\"1\"}",
- "UserDefaultLanguage"
- }
- );
- migrationBuilder.InsertData(
- table: "Fields",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "FormViewId",
- "PlaceholderId",
- "FieldPosition",
- "IsRequired",
- "IsEditable",
- "IsVisible",
- "FormAttributeId"
- },
- values: new object[]
- {
- 4,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- 1,
- 0,
- 3,
- true,
- true,
- true,
- 4
- }
- );
- // Insert default Polish language to Languages table
- migrationBuilder.InsertData(
- table: "Languages",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "Name",
- "Code"
- },
- values: new object[]
- {
- 1,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- "Polski",
- "PL"
- }
- );
- #endregion
- #region Update Admin
- // (DocumentId = 1)
- migrationBuilder.InsertData(
- table: "DocumentChoiceValues",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "DocumentId",
- "FormAttributeId",
- "ValueId",
- "ValueName"
- },
- values: new object[]
- {
- 1,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- 1,
- 4,
- 1,
- "Polski"
- }
- );
- #endregion
- migrationBuilder.InsertData(
- table: "Documents",
- columns: new[] {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "FormId",
- "Text1",
- "Text2"
- },
- values: new object[] {
- 2,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- 1,
- "User First Name",
- "User Last Name"
- });
- //DocumentId = 2
- migrationBuilder.InsertData(
- table: "DocumentChoiceValues",
- columns: new[]
- {
- "Id",
- "CreatedAt",
- "UpdatedAt",
- "DocumentId",
- "FormAttributeId",
- "ValueId",
- "ValueName"
- },
- values: new object[]
- {
- 2,
- new DateTime(2019, 01, 30),
- new DateTime(2019, 01, 30),
- 2,
- 4,
- 1,
- "Polski"
- }
- );
- //username: user
- //password: user
- migrationBuilder.InsertData(
- table: "AspNetUsers",
- columns: new[]
- {
- "Id",
- "DocumentId",
- "UserName",
- "NormalizedUserName",
- "EmailConfirmed",
- "PasswordHash",
- "SecurityStamp",
- "ConcurrencyStamp",
- "PhoneNumber",
- "PhoneNumberConfirmed",
- "TwoFactorEnabled",
- "LockoutEnd",
- "LockoutEnabled",
- "AccessFailedCount"
- },
- values: new object[]
- {
- "e02f1e94-1aa1-4b95-915e-e70d976052b9",
- 2,
- "user",
- "USER",
- false,
- "AQAAAAEAACcQAAAAEOeKsP12As6e7GJ4ZkrQE61Mu83Ovy56ixk25YgaEKo6ukR8azafskLbJic7yL1W2g==",
- "6TFI6RHMYVDGMQQO3T542PBZNCYXDH72",
- "7a433e9f-9bed-4796-93ce-776383a3184f",
- null,
- false,
- false,
- null,
- true,
- 0
- }
- );
- migrationBuilder.InsertData(
- table: "ApplicationPermissions",
- columns: new[]
- {
- "ApplicationId",
- "UserId",
- "PermissionType",
- "CreatedAt",
- "UpdatedAt"
- },
- values: new object[]
- {
- 1,
- 1,
- (int)PermissionType.Admin,
- new DateTime(2019, 10, 10),
- new DateTime(2019, 9, 9)
- }
- );
- migrationBuilder.InsertData(
- table: "ApplicationPermissions",
- columns: new[]
- {
- "ApplicationId",
- "UserId",
- "PermissionType",
- "CreatedAt",
- "UpdatedAt"
- },
- values: new object[]
- {
- 1,
- 2,
- (int)PermissionType.User,
- new DateTime(2019, 10, 10),
- new DateTime(2019, 9, 9)
- }
- );
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement