Check out example codes for "create table if not exist rails". It will help you in understanding the concepts better.
Code Example 1
create_table :repo_subscriptions, if_not_exists: true do |t|
t.string :user_name
t.string :repo_name
t.timestamps
end
Learn ReactJs, React Native from akashmittal.com