mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-16 03:41:41 +00:00
Fixes rename_digest_email_to_email_digest migration for PostgreSQL
PostgreSQL uses double quotes to quote columns and expects strings to be quoted with single quotes. Single quoted strings work both for MySQL and PostgreSQL.
This commit is contained in:
parent
21e95aef41
commit
b072350746
1 changed files with 4 additions and 4 deletions
|
@ -2,8 +2,8 @@ class RenameDigestEmailToEmailDigest < ActiveRecord::Migration
|
|||
def up
|
||||
sql = <<-SQL
|
||||
UPDATE #{ActiveRecord::Base.connection.quote_table_name('agents')}
|
||||
SET #{ActiveRecord::Base.connection.quote_column_name('type')} = "Agents::EmailDigestAgent"
|
||||
WHERE #{ActiveRecord::Base.connection.quote_column_name('type')} = "Agents::DigestEmailAgent"
|
||||
SET #{ActiveRecord::Base.connection.quote_column_name('type')} = 'Agents::EmailDigestAgent'
|
||||
WHERE #{ActiveRecord::Base.connection.quote_column_name('type')} = 'Agents::DigestEmailAgent'
|
||||
SQL
|
||||
|
||||
execute sql
|
||||
|
@ -12,8 +12,8 @@ class RenameDigestEmailToEmailDigest < ActiveRecord::Migration
|
|||
def down
|
||||
sql = <<-SQL
|
||||
UPDATE #{ActiveRecord::Base.connection.quote_table_name('agents')}
|
||||
SET #{ActiveRecord::Base.connection.quote_column_name('type')} = "Agents::DigestEmailAgent"
|
||||
WHERE #{ActiveRecord::Base.connection.quote_column_name('type')} = "Agents::EmailDigestAgent"
|
||||
SET #{ActiveRecord::Base.connection.quote_column_name('type')} = 'Agents::DigestEmailAgent'
|
||||
WHERE #{ActiveRecord::Base.connection.quote_column_name('type')} = 'Agents::EmailDigestAgent'
|
||||
SQL
|
||||
|
||||
execute sql
|
||||
|
|
Loading…
Add table
Reference in a new issue