Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
CafeCritic
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
Yevgeniy Agrafenin
CafeCritic
Commits
310d343a
Commit
310d343a
authored
Nov 18, 2023
by
Yevgeniy Agrafenin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#3
Создал миграцию для модели заведения.
parent
b080a144
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
338 additions
and
0 deletions
+338
-0
20231118093200_AddCafeModel.Designer.cs
...Critic/Migrations/20231118093200_AddCafeModel.Designer.cs
+301
-0
20231118093200_AddCafeModel.cs
CafeCritic/Migrations/20231118093200_AddCafeModel.cs
+37
-0
No files found.
CafeCritic/Migrations/20231118093200_AddCafeModel.Designer.cs
0 → 100644
View file @
310d343a
This diff is collapsed.
Click to expand it.
CafeCritic/Migrations/20231118093200_AddCafeModel.cs
0 → 100644
View file @
310d343a
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
;
#
nullable
disable
namespace
CafeCritic.Migrations
{
/// <inheritdoc />
public
partial
class
AddCafeModel
:
Migration
{
/// <inheritdoc />
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
CreateTable
(
name
:
"Cafes"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
int
>(
type
:
"integer"
,
nullable
:
false
)
.
Annotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
),
Title
=
table
.
Column
<
string
>(
type
:
"text"
,
nullable
:
false
),
Description
=
table
.
Column
<
string
>(
type
:
"text"
,
nullable
:
true
),
Image
=
table
.
Column
<
string
>(
type
:
"text"
,
nullable
:
false
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_Cafes"
,
x
=>
x
.
Id
);
});
}
/// <inheritdoc />
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropTable
(
name
:
"Cafes"
);
}
}
}
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