Open Closed

Does ABP support other databases? For example, mysql,oracle #150


0
liaofeng created

for mysql,I made some attempts, but I failed, and I couldn't connect to the database successfully base on ef or nhibernet. by viewing the abp document, it should be supported by the multi database,Do I use the MySQL or Oracle Database ? In addition to the server SQL, for other databases, what attention points, please say it in detail,thank you very much !


5 Answer(s)
  • 0
    hikalkan created
    Support Team

    Hi,

    Since ABP can work with EntityFramework or NHibernate, it can work with any database they support. There is no special thing for ABP. If you can use EF with Oracle, then you should be using it with ABP also.

    I use SQL Server, but I know that some people using Oracle (an example: #99@20744d91-736a-4b26-9307-63d2436b02e6) and MySql (an example: <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero/issues/77">https://github.com/aspnetboilerplate/mo ... /issues/77</a>). So, it's possible. For EF and NHibernate, there are drivers for other DBMS. But I can not share some code since I've not example project. You may ask to other people who is working with these DBMS.

    I just used NHibernate and SQLite in-memory for unit test purposes: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Tests/Abp.NHibernate.Tests/NHibernateTestModule.cs">https://github.com/aspnetboilerplate/as ... tModule.cs</a>

  • 0
    guillaumej created

    I'm starting to believe it's quite had to use ABP out of its comfort zone. Then, I don't think my problem is specific to ABP :)

    I tried to make it using MySql : first, I had to apply <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero/issues/77">https://github.com/aspnetboilerplate/mo ... /issues/77</a> (after fixing it since the ABP code seems to have evolved), and now I'm stuck on an error during migration :

    alter table AbpPermissions drop index IX_UserId MySql.Data.MySqlClient.MySqlException (0x80004005): Cannot drop index 'IX_UserId': needed in a foreign key constraint

    I assume I can fix it using <a class="postlink" href="http://stackoverflow.com/a/8482400">http://stackoverflow.com/a/8482400</a> but there's a lot of fk to remove. I'm going to try to create a single migration files and see it's better handled by mysql

  • 0
    guillaumej created

    So, I created a unique Migration file (create default database, remove all migration files, Add-Migration Initial) and it worked in My SQl

    Maybe you should do that in the srtartup template - nobody is going to down migrate from your migrations.

  • 0
    fabiocord created

    <cite>GuillaumeJ: </cite> So, I created a unique Migration file (create default database, remove all migration files, Add-Migration Initial) and it worked in My SQl

    Maybe you should do that in the srtartup template - nobody is going to down migrate from your migrations.

    GuillaumeJ could you share your migration file please ?

  • 0
    guillaumej created

    Here is it, but really, you should recreate it AllAbpMigrations.zip