2021-09-13 09:39:11 +05:00
|
|
|
создать миграцию
|
|
|
|
```
|
|
|
|
dotnet ef migrations add <MigrationName> --project AsbCloudDb
|
|
|
|
```
|
|
|
|
создать миграцию
|
|
|
|
```
|
|
|
|
dotnet ef migrations remvoe <MigrationName> --project AsbCloudDb
|
|
|
|
```
|
|
|
|
<MigrationName> - Name of migration class
|
2021-09-14 17:17:33 +05:00
|
|
|
После создания миграции обязательно прочитать сгенерированый код.
|
2021-09-13 09:39:11 +05:00
|
|
|
|
|
|
|
Применить миграции
|
2021-09-10 11:28:57 +05:00
|
|
|
```
|
|
|
|
dotnet ef database update --project .\AsbCloudDb
|
2021-09-29 10:09:40 +05:00
|
|
|
```
|
|
|
|
|
|
|
|
#backup
|
|
|
|
```
|
2021-11-13 18:47:11 +05:00
|
|
|
sudo -u postgres pg_dump -Fc -U postgres postgres -W | gzip > 2021-09-27_dump.sql.gz
|
|
|
|
sudo -u postgres pg_dump -Fc -U postgres postgres -W > 2021-11-13_dump.sql.gz
|
2021-09-29 10:09:40 +05:00
|
|
|
```
|
2021-10-31 18:01:32 +05:00
|
|
|
|
|
|
|
#restore
|
|
|
|
```
|
|
|
|
psql postgres < dump_file_name
|
|
|
|
```
|