Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
Webinar_51
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexey Goikolov
Webinar_51
Commits
827c744c
Commit
827c744c
authored
Mar 31, 2021
by
Alexey Goikolov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Создал и применил миграцию AddUserEntity
parent
877598ab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
181 additions
and
0 deletions
+181
-0
20210331150233_AddUserEntity.Designer.cs
Lesson49/Migrations/20210331150233_AddUserEntity.Designer.cs
+130
-0
20210331150233_AddUserEntity.cs
Lesson49/Migrations/20210331150233_AddUserEntity.cs
+31
-0
MobileContextModelSnapshot.cs
Lesson49/Migrations/MobileContextModelSnapshot.cs
+20
-0
No files found.
Lesson49/Migrations/20210331150233_AddUserEntity.Designer.cs
0 → 100644
View file @
827c744c
// <auto-generated />
using
Lesson49.Models.Data
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Infrastructure
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Storage.ValueConversion
;
namespace
Lesson49.Migrations
{
[
DbContext
(
typeof
(
MobileContext
))]
[
Migration
(
"20210331150233_AddUserEntity"
)]
partial
class
AddUserEntity
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
#pragma warning disable 612, 618
modelBuilder
.
HasAnnotation
(
"ProductVersion"
,
"3.1.13"
);
modelBuilder
.
Entity
(
"Lesson49.Models.Brand"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
bool
>(
"IsActive"
)
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"TEXT"
);
b
.
Property
<
string
>(
"WebSite"
)
.
HasColumnType
(
"TEXT"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Brands"
);
});
modelBuilder
.
Entity
(
"Lesson49.Models.Order"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
string
>(
"Address"
)
.
HasColumnType
(
"TEXT"
);
b
.
Property
<
string
>(
"ContactPhone"
)
.
HasColumnType
(
"TEXT"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"TEXT"
);
b
.
Property
<
int
>(
"PhoneId"
)
.
HasColumnType
(
"INTEGER"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"PhoneId"
);
b
.
ToTable
(
"Orders"
);
});
modelBuilder
.
Entity
(
"Lesson49.Models.Phone"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
int
>(
"BrandId"
)
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
bool
>(
"IsDeleted"
)
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"TEXT"
);
b
.
Property
<
double
>(
"Price"
)
.
HasColumnType
(
"REAL"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"BrandId"
);
b
.
ToTable
(
"Phones"
);
});
modelBuilder
.
Entity
(
"Lesson49.Models.User"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
int
>(
"Age"
)
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"TEXT"
);
b
.
Property
<
string
>(
"Surname"
)
.
HasColumnType
(
"TEXT"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Users"
);
});
modelBuilder
.
Entity
(
"Lesson49.Models.Order"
,
b
=>
{
b
.
HasOne
(
"Lesson49.Models.Phone"
,
"Phone"
)
.
WithMany
()
.
HasForeignKey
(
"PhoneId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Lesson49.Models.Phone"
,
b
=>
{
b
.
HasOne
(
"Lesson49.Models.Brand"
,
"Brand"
)
.
WithMany
()
.
HasForeignKey
(
"BrandId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
#pragma warning restore 612, 618
}
}
}
Lesson49/Migrations/20210331150233_AddUserEntity.cs
0 → 100644
View file @
827c744c
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
Lesson49.Migrations
{
public
partial
class
AddUserEntity
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
CreateTable
(
name
:
"Users"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
int
>(
nullable
:
false
)
.
Annotation
(
"Sqlite:Autoincrement"
,
true
),
Name
=
table
.
Column
<
string
>(
nullable
:
true
),
Surname
=
table
.
Column
<
string
>(
nullable
:
true
),
Age
=
table
.
Column
<
int
>(
nullable
:
false
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_Users"
,
x
=>
x
.
Id
);
});
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropTable
(
name
:
"Users"
);
}
}
}
Lesson49/Migrations/MobileContextModelSnapshot.cs
View file @
827c744c
...
...
@@ -85,6 +85,26 @@ namespace Lesson49.Migrations
b
.
ToTable
(
"Phones"
);
});
modelBuilder
.
Entity
(
"Lesson49.Models.User"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
int
>(
"Age"
)
.
HasColumnType
(
"INTEGER"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"TEXT"
);
b
.
Property
<
string
>(
"Surname"
)
.
HasColumnType
(
"TEXT"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Users"
);
});
modelBuilder
.
Entity
(
"Lesson49.Models.Order"
,
b
=>
{
b
.
HasOne
(
"Lesson49.Models.Phone"
,
"Phone"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment