- 1259f58 Crystal v0.30.0 changes (#1126) by @bcardiff @drujensen
- 3465f1d Linting issues (#1117) by @veelenga
- e933401 Clean up assets (#1113) by @smadeja
BREAKING CHANGES
The DSL for Granite have been changed. In order to upgrade from 0.29.0 or earlier, make the following modifications:
In the config/database.cr
, replace the Granite::Adapters line with:
Granite::Connections << Granite::Adapter::Mysql.new(name: "mysql", url: Amber.settings.database_url)
In your models, replace adapter
with connection
, table_name
with table
, primary
with column .., primary: true
, and field
with column
. Also, add a ?
for Nilable columns. Here is an example model:
class Post < Granite::Base
connection mysql
table posts
belongs_to :user
column id : Int64, primary: true
column title : String?
column body : String?
timestamps
end