Plugins - Schema Definition

StarAdd to favorites

Schema Definition

A Ruby on Rails plugin for easy migration generation. Based on Auto-Migrations by PJ Hyett.

Usage

Create a copy of your schema.rb file and name it definition.rb. Now, when you need to change database schema, edit definition.rb file. Then, invoke

  $ ruby/script generate migration

It will generate a new migration with all differencies of definition.rb against your current database schema! You can migrate immediately, or add some more tweaks to your migration, or something else.

Why is it great? Because you don’t need to remember all that syntax like change_column, add_column, etc - you just modify your schema (in file definition.rb).

Nice bonus: migrations are automatically named (of course you may override name suggested).

How to install

ruby script/plugin install http://schema-definition.googlecode.com/svn/tags/stable/schema-definition

Todo

Indices are not supported at the moment.

Legal

Found a bug? Email it to me: pavel.vasev@gmail.com

Want to add a feature? Implement it and email patch to me!

Pavel Vasev [ pavel.vasev@gmail.com ]

Released under the MIT license (included)

p.s. Schema-Definition plugin is hugely based on Auto-Migrations by PJ Hyett

Pavel Vasev

http://www.lact.ru/e/703-generator-migratsiy-dlya-ruby-on-rails

http://schema-definition.googlecode.com/svn/tags/stable/schema-definition

Rails' (MIT)

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Misc. Enhancements

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?