I try the ordinary EF CodeFirst test with latest packages for new FB3.

<packages>
   <package id="EntityFramework" version="6.1.3" targetFramework="net452" />
   <package id="EntityFramework.Firebird" version="4.10.0.0" 
targetFramework="net452" />
   <package id="FirebirdSql.Data.FirebirdClient" version="4.10.0.0" 
targetFramework="net452" />
</packages>

---------------------

public class Blog
   {
     public int      id        { get; set; }
     public string   name      { get; set; }
     public DateTime created   { get; set; }
     public string   comment   { get; set; }

     public virtual List<Post> posts { get; set; }
   }

   public class Post
   {
     public int id { get; set; }
     public string content { get; set; }

     public int blogId { get; set; }

     public virtual Blog blog { get; set; }
   }

....

   public TestContext()
         : base(connection, true)
     {

     }

     public DbSet<Blog> Blog { get; set; }
     public DbSet<Post> Posts { get; set; }
   }

...

Database.SetInitializer(new MigrateDatabaseToLatestVersion<TestContext, 
Configuration>());

-------------------------------------

This code creates this table definition:

CREATE TABLE "Posts"
(
   "id" Integer NOT NULL,
   "content" Blob sub_type 1,
   "blogId" Integer NOT NULL,
   CONSTRAINT "PK_Posts" PRIMARY KEY ("id")
);
ALTER TABLE "Posts" ADD CONSTRAINT "FK_Posts_Blogs_blogId"
   FOREIGN KEY ("blogId") REFERENCES "Blogs" ("id") ON DELETE CASCADE;
CREATE INDEX "IX_Posts_blogId" ON "Posts" ("blogId");
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
  ON "Posts" TO  SYSDBA WITH GRANT OPTION;

----------------------------------------

BUT: why is created a "IX_Posts_blogId" index when the 
"FK_Posts_Blogs_blogId" index created for FK?

eMeL



------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-dig...@yahoogroups.com 
    firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

  • [firebird-su... 'e...@emel.hu' e...@emel.hu [firebird-support]
    • Re: [fi... 'Thomas Steinmaurer' t...@iblogmanager.com [firebird-support]
    • Re: [fi... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
      • Re:... kristinwens...@yahoo.com [firebird-support]

Reply via email to