I was implementing Carrierwave with possibility to upload multiple files, so according to this source Add more files and remove single file Carrierwave tutorial I had to create a migration to add empty array to the database, like this:
add_column :products, :tags, :string, array: true, default: []
Since I was using Sqlite3, I faced an issue - it didint let me store array into the db. I tried few things, like to store that array as a string:
default: [].join(",")
and then change it from controller, but still couldn't find suitable solution. Then I gave up and switched Sqlite3 to pg database. Looks like all it is all fine now - migration went well. So now I am using pg database in both - development and production environments. But since I am newby on these things I am afraid for future fails. So my questions:
- Do you think its ok to use pg db in development env?
- What is the mainreason to use Sqlite3 - only the ease of configuration?
- Any advises, thoughts on this topic very welcome.
Many thanks!