clarify_schema:声明您的Railsactive_record模型架构,并为您生成数据库迁移!

时间:2021-02-23 02:28:27
【文件属性】:
文件名称:clarify_schema:声明您的Railsactive_record模型架构,并为您生成数据库迁移!
文件大小:74KB
文件格式:ZIP
更新时间:2021-02-23 02:28:27
Ruby 声明架构 声明您的Rails / active_record模型架构,并为您生成数据库迁移! 例子 创建一个模型并在一个fields do ... end声明您的模式fields do ... end class Company < ActiveRecord :: Base fields do company_name :string , limit : 100 ticker_symbol :string , limit : 4 , null : true , index : true , unique : true employee_count :integer comments :text timestamps end belongs_to :industry end 然后生成迁移: $ rails generate decla
【文件预览】:
declare_schema-master
----gemfiles()
--------rails_6_sqlite.gemfile(361B)
--------rails_6_mysql.gemfile(360B)
--------rails_5_sqlite.gemfile(361B)
--------rails_4_sqlite.gemfile(373B)
--------rails_4_mysql.gemfile(360B)
--------.bundle()
--------rails_5_mysql.gemfile(360B)
----.github()
--------dependabot.yml(280B)
--------workflows()
----LICENSE.txt(1KB)
----.ruby-version(6B)
----lib()
--------declare_schema.rb(1KB)
--------generators()
--------declare_schema()
----Gemfile(401B)
----declare_schema.gemspec(822B)
----spec()
--------lib()
--------spec_helper.rb(2KB)
--------support()
----Rakefile(2KB)
----README.md(5KB)
----.rubocop.yml(3KB)
----test_responses.txt(11B)
----Appraisals(480B)
----.rspec(30B)
----Gemfile.lock(5KB)
----.gitignore(148B)
----bin()
--------declare_schema(320B)
----CHANGELOG.md(7KB)

网友评论