Update database scheme?

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
steffen_w
Posts: 16
Joined: Wed 06 Mar 2013 14:28

Update database scheme?

Post by steffen_w » Mon 18 Jul 2016 08:53

Hi,

I wondered if there is a method to update an existing database scheme. I've not found one yet but as there is a way to create a new database, I hope that there is also a similiar method to update it.

If not, what is the recommended way to update a database that does not run on a system I, as the developer, have access to? [Server of a customer for example]

I'm using C#/Devart LinqConnect 5.0.1441.0 with MySQL/MariaDB.

The original change to the database scheme would've been made with the EntityDeveloper.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Update database scheme?

Post by Shalex » Tue 19 Jul 2016 10:15

There is no such method as UpdateSchema() for DataContext. We will notify you when the corresponding functionality is implemented. We cannot provide any timeframe at the moment.

steffen_w
Posts: 16
Joined: Wed 06 Mar 2013 14:28

Re: Update database scheme?

Post by steffen_w » Tue 19 Jul 2016 13:55

Thank you for the fast reply.

Just kind of expected there to be such a method already as it is possible to update the scheme of a SQLite database from C#. (Well, you've to do it per table but it's possible).

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Update database scheme?

Post by Shalex » Wed 20 Jul 2016 08:05

You are asking for the DataContext.UpdateSchema() functionality for both MySQL and SQLite databases, aren't you? If not, please clarify your previous comments.

steffen_w
Posts: 16
Joined: Wed 06 Mar 2013 14:28

Re: Update database scheme?

Post by steffen_w » Wed 20 Jul 2016 14:03

Not specifically. I'm asking for a way, any way, to update the scheme of an existing database (adding a new column or table for example).

In SQLite the CreateTable method updates a table if it exists but differs.

For example:
* Create database design and database with EntityDeveloper, create a program that connects to this database
* Change the database design in EntityDeveloper, generate the new C# code but do not update the database
* Inside the program call 'CreateTable' on the table that was changed in the above step

In MySQL I do not have the CreateTable method nor do I seem to have another way to update a database.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Update database scheme?

Post by Shalex » Fri 22 Jul 2016 13:51

We will notify you when the corresponding functionality is implemented. We cannot provide any timeframe at the moment.

Post Reply