luckyframework/avram

Alternate column names

开放

#378 创建于 2020年5月27日

 (6 条评论) (3 个反应) (0 位负责人)Crystal (67 个派生)auto 404
feature requesthacktoberfest

仓库指标

星标
 (180 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

We have several apps built in different languages that use the same database. At some point in the last 15 years of this app running, some columns have been named wonky or misspelled. We can't just easily run a RENAME COLUMN migration because there's no telling where all this thing may be called.

What if we had a way to rename the method that calls a column?

table do
  column email : String, from: "employeemail"
end

This way I could also do UserQuery.new.email("b@a.com") which would still generate SELECT * FROM users WHERE employeemail = 'b@a.com'

贡献者指南