Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
6b96a1ea
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6b96a1ea
编写于
12月 14, 2014
作者:
Z
Zachary Scott
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add `null` option to timestamps as migration generator does [ci skip]
上级
7607687c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
25 deletion
+25
-25
guides/source/active_record_basics.md
guides/source/active_record_basics.md
+1
-1
guides/source/active_record_migrations.md
guides/source/active_record_migrations.md
+3
-3
guides/source/association_basics.md
guides/source/association_basics.md
+19
-19
guides/source/getting_started.md
guides/source/getting_started.md
+2
-2
未找到文件。
guides/source/active_record_basics.md
浏览文件 @
6b96a1ea
...
...
@@ -358,7 +358,7 @@ class CreatePublications < ActiveRecord::Migration
t
.
string
:publisher_type
t
.
boolean
:single_issue
t
.
timestamps
t
.
timestamps
null:
false
end
add_index
:publications
,
:publication_type_id
end
...
...
guides/source/active_record_migrations.md
浏览文件 @
6b96a1ea
...
...
@@ -39,7 +39,7 @@ class CreateProducts < ActiveRecord::Migration
t
.
string
:name
t
.
text
:description
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -285,7 +285,7 @@ class CreateProducts < ActiveRecord::Migration
t
.
string
:name
t
.
text
:description
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -826,7 +826,7 @@ class CreateProducts < ActiveRecord::Migration
create_table
:products
do
|
t
|
t
.
string
:name
t
.
text
:description
t
.
timestamps
t
.
timestamps
null:
false
end
end
...
...
guides/source/association_basics.md
浏览文件 @
6b96a1ea
...
...
@@ -101,13 +101,13 @@ class CreateOrders < ActiveRecord::Migration
def
change
create_table
:customers
do
|
t
|
t
.
string
:name
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:orders
do
|
t
|
t
.
belongs_to
:customer
,
index:
true
t
.
datetime
:order_date
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -132,13 +132,13 @@ class CreateSuppliers < ActiveRecord::Migration
def
change
create_table
:suppliers
do
|
t
|
t
.
string
:name
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:accounts
do
|
t
|
t
.
belongs_to
:supplier
,
index:
true
t
.
string
:account_number
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -165,13 +165,13 @@ class CreateCustomers < ActiveRecord::Migration
def
change
create_table
:customers
do
|
t
|
t
.
string
:name
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:orders
do
|
t
|
t
.
belongs_to
:customer
,
index
:true
t
.
datetime
:order_date
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -207,19 +207,19 @@ class CreateAppointments < ActiveRecord::Migration
def
change
create_table
:physicians
do
|
t
|
t
.
string
:name
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:patients
do
|
t
|
t
.
string
:name
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:appointments
do
|
t
|
t
.
belongs_to
:physician
,
index:
true
t
.
belongs_to
:patient
,
index:
true
t
.
datetime
:appointment_date
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -291,19 +291,19 @@ class CreateAccountHistories < ActiveRecord::Migration
def
change
create_table
:suppliers
do
|
t
|
t
.
string
:name
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:accounts
do
|
t
|
t
.
belongs_to
:supplier
,
index:
true
t
.
string
:account_number
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:account_histories
do
|
t
|
t
.
belongs_to
:account
,
index:
true
t
.
integer
:credit_rating
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -332,12 +332,12 @@ class CreateAssembliesAndParts < ActiveRecord::Migration
def
change
create_table
:assemblies
do
|
t
|
t
.
string
:name
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:parts
do
|
t
|
t
.
string
:part_number
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:assemblies_parts
,
id:
false
do
|
t
|
...
...
@@ -371,13 +371,13 @@ class CreateSuppliers < ActiveRecord::Migration
def
change
create_table
:suppliers
do
|
t
|
t
.
string
:name
t
.
timestamps
t
.
timestamps
null:
false
end
create_table
:accounts
do
|
t
|
t
.
integer
:supplier_id
t
.
string
:account_number
t
.
timestamps
t
.
timestamps
null:
false
end
add_index
:accounts
,
:supplier_id
...
...
@@ -455,7 +455,7 @@ class CreatePictures < ActiveRecord::Migration
t
.
string
:name
t
.
integer
:imageable_id
t
.
string
:imageable_type
t
.
timestamps
t
.
timestamps
null:
false
end
add_index
:pictures
,
:imageable_id
...
...
@@ -471,7 +471,7 @@ class CreatePictures < ActiveRecord::Migration
create_table
:pictures
do
|
t
|
t
.
string
:name
t
.
references
:imageable
,
polymorphic:
true
,
index:
true
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -501,7 +501,7 @@ class CreateEmployees < ActiveRecord::Migration
def
change
create_table
:employees
do
|
t
|
t
.
references
:manager
,
index:
true
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
guides/source/getting_started.md
浏览文件 @
6b96a1ea
...
...
@@ -677,7 +677,7 @@ class CreateArticles < ActiveRecord::Migration
t
.
string
:title
t
.
text
:text
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
@@ -1539,7 +1539,7 @@ class CreateComments < ActiveRecord::Migration
# this line adds an integer column called `article_id`.
t
.
references
:article
,
index:
true
t
.
timestamps
t
.
timestamps
null:
false
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录