{"action":"created","issue":{"url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql/issues/26","repository_url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql","labels_url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql/issues/26/comments","events_url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql/issues/26/events","html_url":"https://github.com/npgsql/EntityFramework6.Npgsql/issues/26","id":154486434,"number":26,"title":"error: 42883: function uuid_generate_v4() does not exist","user":{"login":"roji","id":1862641,"avatar_url":"https://avatars.githubusercontent.com/u/1862641?v=3","gravatar_id":"","url":"https://api.github.com/users/roji","html_url":"https://github.com/roji","followers_url":"https://api.github.com/users/roji/followers","following_url":"https://api.github.com/users/roji/following{/other_user}","gists_url":"https://api.github.com/users/roji/gists{/gist_id}","starred_url":"https://api.github.com/users/roji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roji/subscriptions","organizations_url":"https://api.github.com/users/roji/orgs","repos_url":"https://api.github.com/users/roji/repos","events_url":"https://api.github.com/users/roji/events{/privacy}","received_events_url":"https://api.github.com/users/roji/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql/labels/bug","name":"bug","color":"ee0701"},{"url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql/labels/ef6","name":"ef6","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-12T13:47:06Z","updated_at":"2016-05-12T13:47:11Z","closed_at":null,"body":"_From @raditch on October 20, 2015 10:26_\n\nMaybe to fix it NpgsqlMigrationSqlGenerator can call create extension \"uuid-ossp\" somewhere after create schema?\r\n\r\nMinimal test to reproduce:\r\n\r\n\tpublic class Foo\r\n\t{\r\n\t\t// if comment out line below - the test works\r\n\t\t[DatabaseGenerated(DatabaseGeneratedOption.Identity)]\r\n\t\t[Key]\r\n\t\tpublic Guid Id { get; set; }\r\n\t}\r\n\r\n\tpublic class MyContext : DbContext\r\n\t{\r\n\t\tpublic DbSet<Foo> Foos { get; set; }\r\n\t\tprotected override void OnModelCreating(DbModelBuilder modelBuilder)\r\n\t\t{\r\n\t\t\tmodelBuilder.HasDefaultSchema(\"public\");\r\n\t\t\tbase.OnModelCreating(modelBuilder);\r\n\t\t}\r\n\t}\r\n\r\n\t[TestClass]\r\n\tpublic class PgFixture\r\n\t{\r\n\t\t[TestMethod]\r\n\t\tpublic void GuidIdentityColumnTest()\r\n\t\t{\r\n\t\t\tDatabase.SetInitializer(new DropCreateDatabaseAlways<MyContext>());\r\n\t\t\tusing (var context = new MyContext())\r\n\t\t\t{\r\n\t\t\t\tcontext.Foos.Add(new Foo());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\n\n_Copied from original issue: npgsql/npgsql#829_"},"comment":{"url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql/issues/comments/218762065","html_url":"https://github.com/npgsql/EntityFramework6.Npgsql/issues/26#issuecomment-218762065","issue_url":"https://api.github.com/repos/npgsql/EntityFramework6.Npgsql/issues/26","id":218762065,"user":{"login":"roji","id":1862641,"avatar_url":"https://avatars.githubusercontent.com/u/1862641?v=3","gravatar_id":"","url":"https://api.github.com/users/roji","html_url":"https://github.com/roji","followers_url":"https://api.github.com/users/roji/followers","following_url":"https://api.github.com/users/roji/following{/other_user}","gists_url":"https://api.github.com/users/roji/gists{/gist_id}","starred_url":"https://api.github.com/users/roji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roji/subscriptions","organizations_url":"https://api.github.com/users/roji/orgs","repos_url":"https://api.github.com/users/roji/repos","events_url":"https://api.github.com/users/roji/events{/privacy}","received_events_url":"https://api.github.com/users/roji/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T13:47:11Z","updated_at":"2016-05-12T13:47:11Z","body":"_From @raditch on October 30, 2015 16:12_\n\n@franciscojunior To create database with EF code first, some must have another database with necessary extension to use it as a template?"}}