Created
August 10, 2021 04:13
-
-
Save Baozi2/14e13d339c6be9551c01b46e2d75d44e to your computer and use it in GitHub Desktop.
rails set default value for jsonb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
def change | |
create_table :test do |t| | |
t.jsonb :names, default: [] | |
t.jsob :profil, default: {} | |
t.timestamps | |
end | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment