module Sequel

This extension is designed to automatically upgrade database schema to correspond to the model definition. It performs basic auto migration.

Usage (models/account.rb):

DB.upgrade_table? :accounts do
  primary_key :id
  column :title, String, :default => 'foobar'
end
class Account < Sequel::Model
end

The :accounts table is created if it does not exist. If it exists and lacks :id or :key column, the corresponding column is added with ALTER TABLE. If the table already has the column, no action is performed on it.