From 5b4feafde06345afc0803a73d14d3e9183271d09 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 12 Jun 2019 07:14:12 -0600 Subject: [PATCH] updating migration for specificities around mysql and postgres --- MIGRATING.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MIGRATING.md b/MIGRATING.md index 420011156..72cba9cda 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -132,9 +132,17 @@ class ConvertToActiveStorage < ActiveRecord::Migration[5.2] # sqlite # get_blob_id = 'LAST_INSERT_ROWID()' + # mysql + # active_storage_blob_statement = ActiveRecord::Base.connection.raw_connection.prepare('active_storage_blob_statement', <<-SQL) + # INSERT INTO active_storage_blobs ( + # `key`, filename, content_type, metadata, byte_size, checksum, created_at + # ) VALUES ($1, $2, $3, '{}', $4, $5, $6) + # SQL + + # postgres active_storage_blob_statement = ActiveRecord::Base.connection.raw_connection.prepare('active_storage_blob_statement', <<-SQL) INSERT INTO active_storage_blobs ( - `key`, filename, content_type, metadata, byte_size, checksum, created_at + "key", filename, content_type, metadata, byte_size, checksum, created_at ) VALUES ($1, $2, $3, '{}', $4, $5, $6) SQL