timwaters / mapwarper

free open source public map georeferencer, georectifier and warper
http://mapwarper.net
MIT License
193 stars 79 forks source link

Database initialization #190

Closed whisere closed 2 years ago

whisere commented 3 years ago

For the Database initialization, what should be done with the code below, is there a yml file these should go before doing bundle install? What exactly is the step for database initialization? Thank you!

Database initialization Creating a new user

user = User.new user.login = "super" user.email = "super@example.com" user.password = "your_password" user.password_confirmation = "your_password" user.save user.confirmed_at = Time.now user.save

role = Role.find_by_name('super user') user = User.find_by_login('super')

permission = Permission.new permission.role = role permission.user = user permission.save

role = Role.find_by_name('administrator') permission = Permission.new permission.role = role permission.user = user permission.save

whisere commented 3 years ago

I figured out that it needs to run 'rails c' first and run each line above one at a time (copy all in the terminal won't work) database setting file yml also need to add host: localhost etc