Browse Source

Merge pull request #1689 from dcagnetta/postgresql_documentation

Added: postgreSQL documentation
pull/1701/head
maliming 7 years ago
committed by GitHub
parent
commit
82767d9a0c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/en/Best-Practices/Index.md
  2. 37
      docs/en/Best-Practices/PostgreSQL-Integration.md
  3. BIN
      docs/en/Best-Practices/images/postgresql-delete-initial-migrations.png
  4. BIN
      docs/en/Best-Practices/images/postgresql-update-database.png
  5. 8
      docs/en/docs-nav.json

2
docs/en/Best-Practices/Index.md

@ -23,5 +23,5 @@ Also, this guide is mostly usable for general **application development**.
* [Data Transfer Objects](Data-Transfer-Objects.md)
* Data Access
* [Entity Framework Core Integration](Entity-Framework-Core-Integration.md)
* [MongoDB Integration](MongoDB-Integration.md)
* [MongoDB Integration](MongoDB-Integration.md)

37
docs/en/Best-Practices/PostgreSQL-Integration.md

@ -0,0 +1,37 @@
## Entity Framework Core PostgreSQL Integration
> See [Entity Framework Core Integration document](../Entity-Framework-Core.md) for the basics of the EF Core integration.
### EntityFrameworkCore Project Update
- In `Acme.BookStore.EntityFrameworkCore` project replace package `Volo.Abp.EntityFrameworkCore.SqlServer` with `Volo.Abp.EntityFrameworkCore.PostgreSql`
- Update to use PostgreSQL in `BookStoreEntityFrameworkCoreModule`.
1. **Do** Replace the `AbpEntityFrameworkCoreSqlServerModule` with the `AbpEntityFrameworkCorePostgreSqlModule`
2. **Do** Replace the `options.UseSqlServer()` with the `options.UsePostgreSql()`
### Update Connection String Settings
- **Do** Update the PostgreSQL connection string in all `appsettings.json` files.
### Regenerate Initial igration & Update the Database
Open the **Package Manager Console (PMC)** (under the *Tools/Nuget Package Manager* menu), select the `Acme.BookStore.EntityFrameworkCore.DbMigrations` as the **default project** and execute the following command:
> Ensure your startup project is correcty set.
#### Delete Existing Initial Migrations
![postgresql-delete-initial-migrations](images/postgresql-delete-initial-migrations.png)
Then create a new migration class inside the `Migrations` folder.
````
PM> Add-Migration Initial
````
Then execute the `Update-Database` command to update the database schema:
````
PM> Update-Database
````
![postgresql-update-database](images/postgresql-update-database.png)

BIN
docs/en/Best-Practices/images/postgresql-delete-initial-migrations.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
docs/en/Best-Practices/images/postgresql-update-database.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

8
docs/en/docs-nav.json

@ -245,7 +245,13 @@
"items": [
{
"text": "Entity Framework Core Integration",
"path": "Entity-Framework-Core.md"
"path": "Entity-Framework-Core.md",
"items": [
{
"text": "PostgreSQL Integration",
"path": "Best-Practices/PostgreSQL-Integration.md"
}
]
},
{
"text": "MongoDB Integration",

Loading…
Cancel
Save