Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bigserial appears with limit 8 for schema dumper #23958

Merged

Conversation

kamipo
Copy link
Member

@kamipo kamipo commented Feb 29, 2016

Before:

create_table "postgresql_big_serials", force: :cascade do |t|
  t.bigserial "seq", limit: 8, null: false
end

After:

create_table "postgresql_big_serials", force: :cascade do |t|
  t.bigserial "seq", null: false
end

@rails-bot
Copy link

r? @arthurnn

(@rails-bot has picked a reviewer for you, use r? to override)

@kamipo kamipo force-pushed the fix_bigserial_appears_with_limit_8 branch 2 times, most recently from 728108b to 76f672e Compare March 2, 2016 00:35
Before:

```ruby
create_table "postgresql_big_serials", force: :cascade do |t|
  t.bigserial "seq", limit: 8, null: false
end
```

After:

```ruby
create_table "postgresql_big_serials", force: :cascade do |t|
  t.bigserial "seq", null: false
end
```
@kamipo kamipo force-pushed the fix_bigserial_appears_with_limit_8 branch from 76f672e to a449b07 Compare March 4, 2016 14:27
@kamipo
Copy link
Member Author

kamipo commented Mar 6, 2016

Currently schema dumper dumps bigserial with limit: 8.
But it is not intended behavior because bigserial(8) is invalid statement.

activerecord_unittest=# create table t (a bigserial(8));
ERROR:  type modifier is not allowed for type "bigint"
LINE 1: create table t (a bigserial(8));

Actually limit: 8 behaves nothing for bigserial because NATIVE_DATABASE_TYPES doesn't include :bigserial.
lib/active_record/connection_adapters/postgresql_adapter.rb#L74-L113
But I think it is better to do not dump limit: 8 for bigserial.

rafaelfranca added a commit that referenced this pull request Mar 11, 2016
Fix bigserial appears with limit 8 for schema dumper
@rafaelfranca rafaelfranca merged commit a101115 into rails:master Mar 11, 2016
@kamipo kamipo deleted the fix_bigserial_appears_with_limit_8 branch March 11, 2016 05:41
sgrif added a commit that referenced this pull request Mar 11, 2016
I'm unsure how this passed CI in the pull request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants