-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(cherry picked from commit ccf3aa8)
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
layout: doc | ||
title: Entity Framework 6 | ||
--- | ||
|
||
Npgsql has an Entity Framework 6 provider. You can use it by installing the | ||
[EntityFramework6.Npgsql](https://www.nuget.org/packages/EntityFramework6.Npgsql/) nuget. | ||
|
||
## Guid Support ## | ||
|
||
Npgsql EF migrations support uses `uuid_generate_v4()` function to generate guids. | ||
In order to have access to this function, you have to install the extension uuid-ossp through the following command: | ||
|
||
```sql | ||
create extension "uuid-ossp"; | ||
``` | ||
|
||
If you don't have this extension installed, when you run Npgsql migrations you will get the following error message: | ||
|
||
``` | ||
ERROR: function uuid_generate_v4() does not exist | ||
``` | ||
|
||
If the database is being created by Npgsql Migrations, you will need to | ||
[run the `create extension` command in the `template1` database](http://stackoverflow.com/a/11584751). | ||
This way, when the new database is created, the extension will be installed already. | ||
|
||
## Template Database ## | ||
|
||
When the Entity Framework 6 provider creates a database, it issues a simple `CREATE DATABASE` command. | ||
In PostgreSQL, this implicitly uses `template1` as the template - anything existing in `template1` will | ||
be copied to your new database. If you wish to change the database used as a template, you can specify | ||
the `EF Template Database` connection string parameter. For more info see the | ||
[PostgreSQL docs](https://www.postgresql.org/docs/current/static/sql-createdatabase.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# [Getting Started](index.md) |