Table issues

May 11, 2011 at 11:49 AM


Have some queries

  • Any support to check if the table exists? Or anything planned in near future?
    Or, if we call CreateTable will it create if it does not exist and not give any error when table already exist?
  • Let's assume that there is some data stored in table 'Person' in the database.  At that time class Person had few properties like 'First Name' and 'Last Name'
    Now later there is a need to add another property 'Age', the database fails to read the existing records (with 2 properties)

    Is there any workaround for cases that require modification schema modification of already saved entities?




May 11, 2011 at 12:03 PM

There is support for TableExist functionality, but it is private.  If you fire CreateTable and it exists, DatabaseExists exception is thrown.  I will put on my todo list to make the DoesTableExists public.

Did you confirm that there is an error in your item 2?  I remember testing that, and I am pretty sure that works.  Wokaround would be to add a settings table and maintain version number in it so that your code would know when and if schema changes need to be applied.  if so, you can always create new table and move data into it.  Like I said though, your scenario "should" work already.  Do you have a set of steps for me to follow to reproduce it?