Module: Sequel::Plugins::Schema

Defined in:


Sequel’s built in schema plugin allows you to define your schema directly in the model using Model.set_schema (which takes a block similar to Database#create_table), and use Model.create_table to create a table using the schema information.

This plugin is mostly suited to test code. If there is any chance that your application’s schema could change, you should be using the migration extension instead.


# Add the schema methods to all model subclasses (called before loading subclasses)
Sequel::Model.plugin :schema

# Add the schema methods to the Album class
Album.plugin :schema

Defined Under Namespace

Modules: ClassMethods