58 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			58 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
								 | 
							
								using Microsoft.EntityFrameworkCore.Migrations;
							 | 
						|||
| 
								 | 
							
								using NodaTime;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								#nullable disable
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace Foxnouns.Backend.Database.Migrations
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    /// <inheritdoc />
							 | 
						|||
| 
								 | 
							
								    public partial class NonNullableSids : Migration
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        /// <inheritdoc />
							 | 
						|||
| 
								 | 
							
								        protected override void Up(MigrationBuilder migrationBuilder)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.AlterColumn<string>(
							 | 
						|||
| 
								 | 
							
								                name: "sid",
							 | 
						|||
| 
								 | 
							
								                table: "users",
							 | 
						|||
| 
								 | 
							
								                type: "text",
							 | 
						|||
| 
								 | 
							
								                nullable: false,
							 | 
						|||
| 
								 | 
							
								                defaultValueSql: "find_free_user_sid()",
							 | 
						|||
| 
								 | 
							
								                oldClrType: typeof(string),
							 | 
						|||
| 
								 | 
							
								                oldType: "text",
							 | 
						|||
| 
								 | 
							
								                oldNullable: true);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.AlterColumn<string>(
							 | 
						|||
| 
								 | 
							
								                name: "sid",
							 | 
						|||
| 
								 | 
							
								                table: "members",
							 | 
						|||
| 
								 | 
							
								                type: "text",
							 | 
						|||
| 
								 | 
							
								                nullable: false,
							 | 
						|||
| 
								 | 
							
								                defaultValueSql: "find_free_member_sid()",
							 | 
						|||
| 
								 | 
							
								                oldClrType: typeof(string),
							 | 
						|||
| 
								 | 
							
								                oldType: "text",
							 | 
						|||
| 
								 | 
							
								                oldNullable: true);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <inheritdoc />
							 | 
						|||
| 
								 | 
							
								        protected override void Down(MigrationBuilder migrationBuilder)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.AlterColumn<string>(
							 | 
						|||
| 
								 | 
							
								                name: "sid",
							 | 
						|||
| 
								 | 
							
								                table: "users",
							 | 
						|||
| 
								 | 
							
								                type: "text",
							 | 
						|||
| 
								 | 
							
								                nullable: true,
							 | 
						|||
| 
								 | 
							
								                oldClrType: typeof(string),
							 | 
						|||
| 
								 | 
							
								                oldType: "text",
							 | 
						|||
| 
								 | 
							
								                oldDefaultValueSql: "find_free_user_sid()");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.AlterColumn<string>(
							 | 
						|||
| 
								 | 
							
								                name: "sid",
							 | 
						|||
| 
								 | 
							
								                table: "members",
							 | 
						|||
| 
								 | 
							
								                type: "text",
							 | 
						|||
| 
								 | 
							
								                nullable: true,
							 | 
						|||
| 
								 | 
							
								                oldClrType: typeof(string),
							 | 
						|||
| 
								 | 
							
								                oldType: "text",
							 | 
						|||
| 
								 | 
							
								                oldDefaultValueSql: "find_free_member_sid()");
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |