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

sqlite >= 3.8.0 supports partial indexes #13350

Merged
merged 1 commit into from Jan 14, 2014
Merged

Conversation

@ccutrer
Copy link
Contributor

ccutrer commented Dec 17, 2013

No description provided.

@rafaelfranca
Copy link
Member

rafaelfranca commented Dec 17, 2013

Do we have tests for this?

@ccutrer
Copy link
Contributor Author

ccutrer commented Dec 17, 2013

there are now (the schema dumper needed to be updated)

@ccutrer
Copy link
Contributor Author

ccutrer commented Jan 10, 2014

any update on this?

@@ -1,3 +1,7 @@
* Enable partial indexes for sqlite >= 3.8.0

This comment has been minimized.

Copy link
@senny
@senny
senny reviewed Jan 14, 2014
View changes
activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb Outdated
@@ -397,13 +401,16 @@ def columns(table_name) #:nodoc:
# Returns an array of indexes for the given table.
def indexes(table_name, name = nil) #:nodoc:
exec_query("PRAGMA index_list(#{quote_table_name(table_name)})", 'SCHEMA').map do |row|
sql = exec_query("SELECT sql FROM sqlite_master WHERE name=#{quote(row['name'])} AND type='index' UNION ALL SELECT sql FROM sqlite_temp_master WHERE name=#{quote(row['name'])} AND type='index'").first['sql']

This comment has been minimized.

Copy link
@senny

senny Jan 14, 2014

Member

can we use heredoc syntax as above:

        sql = <<-SQL
          SELECT name
          FROM sqlite_master
          WHERE type = 'table' AND NOT name = 'sqlite_sequence'
        SQL
@senny
Copy link
Member

senny commented Jan 14, 2014

@ccutrer this is looking good 💛! I added some minor comments. Can you push a rebased version?

@ccutrer
Copy link
Contributor Author

ccutrer commented Jan 14, 2014

@senny thanks for the comments. rebased and updated.

@senny
Copy link
Member

senny commented Jan 14, 2014

👍

senny added a commit that referenced this pull request Jan 14, 2014
sqlite >= 3.8.0 supports partial indexes
@senny senny merged commit 93b38d5 into rails:master Jan 14, 2014
@mszyndel
Copy link

mszyndel commented Jun 13, 2014

Can we backport this to Rails 4.0?

@senny
Copy link
Member

senny commented Jun 13, 2014

new features will not be backported, sorry.

@greysteil greysteil mentioned this pull request May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.