Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
b671ae1e
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,发现更多精彩内容 >>
提交
b671ae1e
编写于
11月 24, 2015
作者:
R
Rafael França
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22214 from kamipo/not_passing_native_database_types_to_table_definition
Not passing `native_database_types` to `TableDefinition`
上级
40acdcfb
fc88e4a5
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
6 addition
and
15 deletion
+6
-15
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
...record/connection_adapters/abstract/schema_definitions.rb
+3
-12
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
..._record/connection_adapters/abstract/schema_statements.rb
+1
-1
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
...tive_record/connection_adapters/abstract_mysql_adapter.rb
+1
-1
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
...b/active_record/connection_adapters/postgresql_adapter.rb
+1
-1
未找到文件。
activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
浏览文件 @
b671ae1e
...
...
@@ -206,14 +206,13 @@ class TableDefinition
include
ColumnMethods
attr_accessor
:indexes
attr_reader
:name
,
:temporary
,
:options
,
:as
,
:foreign_keys
,
:native
attr_reader
:name
,
:temporary
,
:options
,
:as
,
:foreign_keys
def
initialize
(
types
,
name
,
temporary
,
options
,
as
=
nil
)
def
initialize
(
name
,
temporary
,
options
,
as
=
nil
)
@columns_hash
=
{}
@indexes
=
{}
@foreign_keys
=
{}
@primary_keys
=
nil
@native
=
types
@temporary
=
temporary
@options
=
options
@as
=
as
...
...
@@ -362,11 +361,8 @@ def references(*args, **options)
def
new_column_definition
(
name
,
type
,
options
)
# :nodoc:
type
=
aliased_types
(
type
.
to_s
,
type
)
column
=
create_column_definition
name
,
type
limit
=
options
.
fetch
(
:limit
)
do
native
[
type
][
:limit
]
if
native
[
type
].
is_a?
(
Hash
)
end
column
.
limit
=
limit
column
.
limit
=
options
[
:limit
]
column
.
precision
=
options
[
:precision
]
column
.
scale
=
options
[
:scale
]
column
.
default
=
options
[
:default
]
...
...
@@ -627,11 +623,6 @@ def foreign_key(*args) # :nodoc:
def
foreign_key_exists?
(
*
args
)
# :nodoc:
@base
.
foreign_key_exists?
(
name
,
*
args
)
end
private
def
native
@base
.
native_database_types
end
end
end
end
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
浏览文件 @
b671ae1e
...
...
@@ -1168,7 +1168,7 @@ def rename_column_indexes(table_name, column_name, new_column_name)
private
def
create_table_definition
(
name
,
temporary
=
false
,
options
=
nil
,
as
=
nil
)
TableDefinition
.
new
native_database_types
,
name
,
temporary
,
options
,
as
TableDefinition
.
new
(
name
,
temporary
,
options
,
as
)
end
def
create_alter_table
(
name
)
...
...
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
浏览文件 @
b671ae1e
...
...
@@ -1039,7 +1039,7 @@ def create_table_info(table_name) # :nodoc:
end
def
create_table_definition
(
name
,
temporary
=
false
,
options
=
nil
,
as
=
nil
)
# :nodoc:
MySQL
::
TableDefinition
.
new
(
na
tive_database_types
,
na
me
,
temporary
,
options
,
as
)
MySQL
::
TableDefinition
.
new
(
name
,
temporary
,
options
,
as
)
end
def
integer_to_sql
(
limit
)
# :nodoc:
...
...
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
浏览文件 @
b671ae1e
...
...
@@ -734,7 +734,7 @@ def extract_table_ref_from_insert_sql(sql) # :nodoc:
end
def
create_table_definition
(
name
,
temporary
=
false
,
options
=
nil
,
as
=
nil
)
# :nodoc:
PostgreSQL
::
TableDefinition
.
new
native_database_types
,
name
,
temporary
,
options
,
as
PostgreSQL
::
TableDefinition
.
new
(
name
,
temporary
,
options
,
as
)
end
def
can_perform_case_insensitive_comparison_for?
(
column
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录