database-migration

Best practice for SQL Server 2008 schema change

扶醉桌前 提交于 2020-01-23 07:42:36
问题 I am looking for information concerning the following: What are the best practices for updating the schema of my dev DB to my production DB, or even more succinctly making DB schema changes in general. The production database is the back-end for two distinct ASP.NET websites. Our schema change process is fairly robust with each "migration" actually being a .cs file containing the schema changes. We will then use ADO.NET to apply the schema changes against the db. My question is more about the

Database migration

倾然丶 夕夏残阳落幕 提交于 2020-01-16 14:46:30
问题 We are migrating a client's own database schema to our own (both SQL-Server). Most of the mappings from their schema to ours have been indentified and rules been agreed on if the columns don't exactly align (default values etc.) Previously, depending on who was assigned the task, this has been done either with a mixture of sql scripts or one-off vb apps. I was thinking there must be a application (commercial or otherwise) where you can assign these mappings/rules and have it stream the data

Ruby on Rails - sqlite 3 rake migrations not updating the database

↘锁芯ラ 提交于 2020-01-14 05:26:40
问题 I am using RoR (3.2.2) and SQLite 3 (1.3.5). When I initially generate a model I am able to successfully create a database. However, whenever I try to use the migration generator it appears to not have any issues in the command line (no errors), but when I check the database nothing has updated or changed. For example, I create this database: $ rails generate model User name:string email:string db/migrate/[timestamp]_create_users.rb class CreateUsers < ActiveRecord::Migration def change

Entity Framework 5 - Migrations and creating table from entity

纵然是瞬间 提交于 2020-01-13 16:55:25
问题 I am using Entity Framework 5 RC and i have some code that require a specific table on the database. The entity is already created using Code-First. a) Is there a way to tell EF to create the table if its not already created in the database ? If yes.. how ? b) Also.. if the table already exist, can it handle entity changes such adding properties to the entity.. will it get reflected on the database ? (We still use the code-first approach here) Thanks! 回答1: Use code first migrations (either

Grails database migration on deployed server

半城伤御伤魂 提交于 2020-01-13 11:39:29
问题 Hi everyone I am encountering a problem/confusion with grails database migration plugin. Resources used for studying- Official Grails Database Migration Plugin documentation- http://grails-plugins.github.io/grails-database-migration/docs/manual/guide/introduction.html Database migration example- http://grails.github.io/grails-howtos/en/manageDatabases.html Now with the help of these I am very well able to migrate or do changes to my database on the local machine which has grails installed and

Migrating from Cake 1.3 to 2.0 and beyond - migrate existing, or only use for new?

耗尽温柔 提交于 2020-01-12 06:59:33
问题 I'm nearling completion of my first CakePHP-driven website and just saw they're already working on CakePHP 2.0 (not the stable release yet). My questions: Is it incredibly time consuming to move to a new version of CakePHP (when it becomes the "stable" release that is)? I know they have migration guides, but - I've never used a framework before, so I've never had to migrate anything. Do you migrate your code for existing projects, or leave it as is and use the new stable version for future

PostgreSQL to MySQL data migration

爷,独闯天下 提交于 2020-01-11 11:34:28
问题 I am trying to move my PostgreSQL database with all the data inside it to a MySQL database so I am using MySQL Workbench > Data migration tool. On the "Reverse Engineer Source" step I got a strange error: ERROR: Reverse engineer selected schemata: ProgrammingError("('42P01', '[42P01] ERROR: relation "public.psqlcfg_lid_seq" does not exist;\nError while executing the query (7) (SQLExecDirectW)')"): error calling Python module function DbPostgresqlRE.reverseEngineer Failed The complete error

How to drop a table in Entity Framework Code First?

 ̄綄美尐妖づ 提交于 2020-01-11 08:22:28
问题 I am using Entity Framework with Auto Migrations. So when I add a new model to my Context, my database is updated and new table is created. What I want to do is the opposite, droping the table completely from database. However, removing the definition from Context class does not work. public class CompanyContext : DbContext { public DbSet<Permission> Permissions { get; set; } public DbSet<Company> Companies { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) {

Laravel: Run migrations on another database

允我心安 提交于 2020-01-10 13:09:42
问题 In my app every user has its own database that created when user registered. Connection and database data (database name, username, password) are saved in a table in default database. try{ DB::transaction(function() { $website = new Website(); $website->user_id = Auth::get()->id; $website->save(); $database_name = 'website_'.$website->id; DB::statement(DB::raw('CREATE DATABASE ' . $database_name)); $websiteDatabase = new WebsiteDatabase(); $websiteDatabase->website_id = $website->id;

Laravel: Run migrations on another database

不羁岁月 提交于 2020-01-10 13:05:17
问题 In my app every user has its own database that created when user registered. Connection and database data (database name, username, password) are saved in a table in default database. try{ DB::transaction(function() { $website = new Website(); $website->user_id = Auth::get()->id; $website->save(); $database_name = 'website_'.$website->id; DB::statement(DB::raw('CREATE DATABASE ' . $database_name)); $websiteDatabase = new WebsiteDatabase(); $websiteDatabase->website_id = $website->id;