Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
c4957f8c
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,发现更多精彩内容 >>
提交
c4957f8c
编写于
2月 26, 2017
作者:
A
Andrew White
提交者:
GitHub
2月 26, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #28188 from kamipo/use_max_identifier_length_for_index_name_length
Use `max_identifier_length` for `index_name_length`
上级
945c3cd5
64e494f7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
8 deletion
+8
-8
activerecord/CHANGELOG.md
activerecord/CHANGELOG.md
+4
-0
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
...ecord/connection_adapters/postgresql/schema_statements.rb
+0
-4
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
...b/active_record/connection_adapters/postgresql_adapter.rb
+3
-2
activerecord/test/cases/adapters/postgresql/connection_test.rb
...erecord/test/cases/adapters/postgresql/connection_test.rb
+1
-2
未找到文件。
activerecord/CHANGELOG.md
浏览文件 @
c4957f8c
*
Use
`max_identifier_length`
for
`index_name_length`
in PostgreSQL adapter.
*Ryuta Kamizono*
*
Deprecate
`supports_migrations?`
on connection adapters.
*Ryuta Kamizono*
...
...
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
浏览文件 @
c4957f8c
...
...
@@ -615,10 +615,6 @@ def extract_foreign_key_action(specifier) # :nodoc:
end
end
def
index_name_length
63
end
# Maps logical Rails types to PostgreSQL-specific data types.
def
type_to_sql
(
type
,
limit:
nil
,
precision:
nil
,
scale:
nil
,
array:
nil
,
**
)
# :nodoc:
sql
=
\
...
...
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
浏览文件 @
c4957f8c
...
...
@@ -215,7 +215,7 @@ def initialize(connection, logger, connection_parameters, config)
# @local_tz is initialized as nil to avoid warnings when connect tries to use it
@local_tz
=
nil
@
table_alias
_length
=
nil
@
max_identifier
_length
=
nil
connect
add_pg_encoders
...
...
@@ -358,8 +358,9 @@ def extensions
# Returns the configured supported identifier length supported by PostgreSQL
def
table_alias_length
@
table_alias_length
||=
query
(
"SHOW max_identifier_length"
,
"SCHEMA"
)[
0
][
0
]
.
to_i
@
max_identifier_length
||=
select_value
(
"SHOW max_identifier_length"
,
"SCHEMA"
)
.
to_i
end
alias
index_name_length
table_alias_length
# Set the authorized user for this session
def
session_auth
=
(
user
)
...
...
activerecord/test/cases/adapters/postgresql/connection_test.rb
浏览文件 @
c4957f8c
...
...
@@ -105,7 +105,7 @@ def test_table_exists_logs_name
end
def
test_table_alias_length_logs_name
@connection
.
instance_variable_set
(
"@
table_alias
_length"
,
nil
)
@connection
.
instance_variable_set
(
"@
max_identifier
_length"
,
nil
)
@connection
.
table_alias_length
assert_equal
"SCHEMA"
,
@subscriber
.
logged
[
0
][
1
]
end
...
...
@@ -177,7 +177,6 @@ def test_reconnection_after_actual_disconnection_with_verify
assert_not_equal
original_connection_pid
,
new_connection_pid
,
"umm -- looks like you didn't break the connection, because we're still "
\
"successfully querying with the same connection pid."
ensure
# Repair all fixture connections so other tests won't break.
@fixture_connections
.
each
(
&
:verify!
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录