luckyframework/avram

Alternate column names

オープン

#378 opened on 2020/05/27

 (6 件のコメント) (3 件のリアクション) (0 人の担当者)Crystal (67 件のフォーク)auto 404
feature requesthacktoberfest

Repository metrics

Stars
 (180 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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'

コントリビューターガイド