Sha256: c4ee414e2f7bc32f05c25d30e4a0f9313567c921b5f3432e286a2db8c6acba0f

Contents?: true

Size: 402 Bytes

Versions: 6

Compression:

Stored size: 402 Bytes

Contents

class SnippetModelMigration < Migration
  def self.up(site)
    site.records.create_model :snippets do |snippets|
      add_field :name, :string, validations: {required: {}}, index: true
      add_field :show_in_search, :boolean, default: false, display: false
      add_field :content, :text
      snippets.searchable = false
    end
  end
  
  def self.down(site)
    site.snippets.destroy
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
yodel-0.0.7 lib/yodel/models/migrations/06_snippet_model.rb
yodel_production_environment-0.0.7 lib/migrations/yodel/06_snippet_model.rb
yodel_development_environment-0.0.7 lib/migrations/yodel/06_snippet_model.rb
yodel-0.0.4 lib/yodel/models/migrations/06_snippet_model.rb
yodel-0.0.3 lib/yodel/models/migrations/06_snippet_model.rb
yodel-0.0.2 lib/yodel/models/migrations/06_snippet_model.rb