This is a long shot, but is anyone aware of any libraries that would compare a database schema with [something] (a script, a c# definition, a backup file...anything) and if any fields, tables, relationships are missing, fix the database?
The idea being that when a user first starts up a program, it adds all the necessary database objects in, and开发者_JAVA百科 then if there's a database update any time, it automatically adds that update in, and if the user decides they want to delete a column in the database, it will recreate it automatically?
What you are describing sounds like ruby on rails migrations.
There are two libraries I know of that do this - RikMigrations and MigratorDotNet for the .NET platform.
You can use NHibernate Mappings and schema Export to generate your database and check the schema each time you start you application.
精彩评论