@ -50,7 +50,7 @@ namespace StubbedContextLib.Migrations
{
{
Id = table . Column < int > ( type : "int" , nullable : false )
Id = table . Column < int > ( type : "int" , nullable : false )
. Annotation ( "SqlServer:Identity" , "1, 1" ) ,
. Annotation ( "SqlServer:Identity" , "1, 1" ) ,
Title = table . Column < string > ( type : "nvarchar( 50)", maxLength : 5 0, nullable : false ) ,
Title = table . Column < string > ( type : "nvarchar( 100)", maxLength : 10 0, nullable : false ) ,
Year = table . Column < int > ( type : "int" , nullable : false ) ,
Year = table . Column < int > ( type : "int" , nullable : false ) ,
TypeSrc = table . Column < int > ( type : "int" , nullable : false )
TypeSrc = table . Column < int > ( type : "int" , nullable : false )
} ,
} ,
@ -153,13 +153,13 @@ namespace StubbedContextLib.Migrations
{
{
Id = table . Column < int > ( type : "int" , nullable : false )
Id = table . Column < int > ( type : "int" , nullable : false )
. Annotation ( "SqlServer:Identity" , "1, 1" ) ,
. Annotation ( "SqlServer:Identity" , "1, 1" ) ,
Content = table . Column < string > ( type : "nvarchar( 50)", maxLength : 5 0, nullable : false ) ,
Content = table . Column < string > ( type : "nvarchar( 100)", maxLength : 10 0, nullable : false ) ,
Likes = table . Column < int > ( type : "int" , nullable : false ) ,
Likes = table . Column < int > ( type : "int" , nullable : false ) ,
Langage = table . Column < int > ( type : "int" , nullable : false ) ,
Langage = table . Column < int > ( type : "int" , nullable : false ) ,
IsValid = table . Column < bool > ( type : "bit" , nullable : false ) ,
IsValid = table . Column < bool > ( type : "bit" , nullable : false ) ,
IdCharacter = table . Column < int > ( type : "int" , nullable : false ) ,
IdCharacter = table . Column < int > ( type : "int" , nullable : false ) ,
IdSource = table . Column < int > ( type : "int" , nullable : false ) ,
IdSource = table . Column < int > ( type : "int" , nullable : false ) ,
IdUsersPropose = table . Column < int > ( type : "int" , nullable : fals e)
IdUsersPropose = table . Column < int > ( type : "int" , nullable : tru e)
} ,
} ,
constraints : table = >
constraints : table = >
{
{
@ -180,33 +180,31 @@ namespace StubbedContextLib.Migrations
name : "FK_quotes_users_IdUsersPropose" ,
name : "FK_quotes_users_IdUsersPropose" ,
column : x = > x . IdUsersPropose ,
column : x = > x . IdUsersPropose ,
principalTable : "users" ,
principalTable : "users" ,
principalColumn : "Id" ,
principalColumn : "Id" ) ;
onDelete : ReferentialAction . Cascade ) ;
} ) ;
} ) ;
migrationBuilder . CreateTable (
migrationBuilder . CreateTable (
name : "comments" ,
name : "comments" ,
columns : table = > new
columns : table = > new
{
{
IdUser = table . Column < int > ( type : "int" , nullable : false ) ,
IdQuote = table . Column < int > ( type : "int" , nullable : false ) ,
Id = table . Column < int > ( type : "int" , nullable : false )
Id = table . Column < int > ( type : "int" , nullable : false )
. Annotation ( "SqlServer:Identity" , "1, 1" ) ,
. Annotation ( "SqlServer:Identity" , "1, 1" ) ,
IdUsers = table . Column < int > ( type : "int" , nullable : false ) ,
IdQuote = table . Column < int > ( type : "int" , nullable : false ) ,
DateCommentary = table . Column < DateTime > ( type : "date" , nullable : false ) ,
DateCommentary = table . Column < DateTime > ( type : "date" , nullable : false ) ,
Comment = table . Column < string > ( type : "nvarchar(100)" , maxLength : 100 , nullable : false )
Comment = table . Column < string > ( type : "nvarchar(100)" , maxLength : 100 , nullable : false )
} ,
} ,
constraints : table = >
constraints : table = >
{
{
table . PrimaryKey ( "PK_comments" , x = > x . Id ) ;
table . PrimaryKey ( "PK_comments" , x = > new { x . Id User, x . IdQuote } ) ;
table . ForeignKey (
table . ForeignKey (
name : "FK_comments_quotes_IdQuote" ,
name : "FK_comments_quotes_IdQuote" ,
column : x = > x . IdQuote ,
column : x = > x . IdQuote ,
principalTable : "quotes" ,
principalTable : "quotes" ,
principalColumn : "Id" ,
principalColumn : "Id" ) ;
onDelete : ReferentialAction . Cascade ) ;
table . ForeignKey (
table . ForeignKey (
name : "FK_comments_users_IdUser s ",
name : "FK_comments_users_IdUser ",
column : x = > x . IdUser s ,
column : x = > x . IdUser ,
principalTable : "users" ,
principalTable : "users" ,
principalColumn : "Id" ,
principalColumn : "Id" ,
onDelete : ReferentialAction . Cascade ) ;
onDelete : ReferentialAction . Cascade ) ;
@ -243,14 +241,12 @@ namespace StubbedContextLib.Migrations
name : "FK_favorites_quotes_IdQuote" ,
name : "FK_favorites_quotes_IdQuote" ,
column : x = > x . IdQuote ,
column : x = > x . IdQuote ,
principalTable : "quotes" ,
principalTable : "quotes" ,
principalColumn : "Id" ,
principalColumn : "Id" ) ;
onDelete : ReferentialAction . Cascade ) ;
table . ForeignKey (
table . ForeignKey (
name : "FK_favorites_users_IdUsers" ,
name : "FK_favorites_users_IdUsers" ,
column : x = > x . IdUsers ,
column : x = > x . IdUsers ,
principalTable : "users" ,
principalTable : "users" ,
principalColumn : "Id" ,
principalColumn : "Id" ) ;
onDelete : ReferentialAction . Cascade ) ;
} ) ;
} ) ;
migrationBuilder . InsertData (
migrationBuilder . InsertData (
@ -378,11 +374,11 @@ namespace StubbedContextLib.Migrations
migrationBuilder . InsertData (
migrationBuilder . InsertData (
table : "comments" ,
table : "comments" ,
columns : new [ ] { "Id ", "Comment" , "DateCommentary" , "Id Quote", "IdUsers " } ,
columns : new [ ] { "Id Quote", "IdUser ", "Comment" , "DateCommentary" , "Id " } ,
values : new object [ , ]
values : new object [ , ]
{
{
{ 1 , "Ce film est le meilleur" , new DateTime ( 2025 , 2 , 3 , 0 , 0 , 0 , 0 , DateTimeKind . Unspecified ) , 1 , 2 } ,
{ 1 , 2 , "Ce film est le meilleur" , new DateTime ( 2025 , 2 , 3 , 0 , 0 , 0 , 0 , DateTimeKind . Unspecified ) , 1 } ,
{ 2 , "Very good" , new DateTime ( 2025 , 3 , 11 , 0 , 0 , 0 , 0 , DateTimeKind . Unspecified ) , 1, 3 }
{ 1, 3 , "Very good" , new DateTime ( 2025 , 3 , 11 , 0 , 0 , 0 , 0 , DateTimeKind . Unspecified ) , 2 }
} ) ;
} ) ;
migrationBuilder . InsertData (
migrationBuilder . InsertData (
@ -420,11 +416,6 @@ namespace StubbedContextLib.Migrations
table : "comments" ,
table : "comments" ,
column : "IdQuote" ) ;
column : "IdQuote" ) ;
migrationBuilder . CreateIndex (
name : "IX_comments_IdUsers" ,
table : "comments" ,
column : "IdUsers" ) ;
migrationBuilder . CreateIndex (
migrationBuilder . CreateIndex (
name : "IX_favorites_IdUsers" ,
name : "IX_favorites_IdUsers" ,
table : "favorites" ,
table : "favorites" ,