{"id":17585006,"url":"https://github.com/tommeier/bootstrap","last_synced_at":"2025-04-28T18:33:18.204Z","repository":{"id":593724,"uuid":"228520","full_name":"tommeier/bootstrap","owner":"tommeier","description":"Bootstrap tools for your Ruby on Rails projects","archived":false,"fork":false,"pushed_at":"2010-10-27T22:38:45.000Z","size":105,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T11:51:14.655Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://github.com/tommeier/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tommeier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-06-16T11:27:19.000Z","updated_at":"2013-10-11T01:42:04.000Z","dependencies_parsed_at":"2022-08-03T00:00:15.803Z","dependency_job_id":null,"html_url":"https://github.com/tommeier/bootstrap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommeier%2Fbootstrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommeier%2Fbootstrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommeier%2Fbootstrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommeier%2Fbootstrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommeier","download_url":"https://codeload.github.com/tommeier/bootstrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251366240,"owners_count":21578093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-22T02:23:50.028Z","updated_at":"2025-04-28T18:33:18.181Z","avatar_url":"https://github.com/tommeier.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bootstrap\n\n## Purpose\n\nCollection of useful rake tasks to make seeding, extracting, maintaining, backup and testing a database with migrations easier. Currently accepting MySQL \u0026 Postgres databases.\n\n## Install\n\n  \tscript/plugin install git://github.com/tommeier/bootstrap.git bootstrap\n\n## Commands (Example Usage)\n\n### Bootstrap - Fixture Load\n\t\trake db:bootstrap:load\n\nLoad a set of CSV's or YML's from \"#{RAILS\\_ROOT}/db/bootstrap\", or pass it parameter \"FIXTURES=\" for a specific set of files to load into the database. Best used for initial loading of the database with data usually required at the start of your projects, such as default users. YML / CSV fixture files can be numbered to ensure the correct ordering of related files eg: 001\\_users.yml, 002\\_roles.yml.\n\n### Bootstrap - Database Dump / Load\n\t\trake db:database_dump\n\t\trake db:database_dump RAILS_ENV=production\t\t\t\t\t\t\t#Dump specific environment using database.yml\n\t\trake db:database_dump file=db/bootstrap/live_database_dump.sql\t\t#Dump to specified location\n\t\trake db:database_dump file_name=live_database_dump.sql\t\t\t\t#Dump file to default bootstrap location\n\t\trake db:database_dump bootstrap=true\t\t\t\t\t\t\t\t#Dump default bootstrap file (for use in specs and initial clean DB load - db/bootstrap/bootstrap_data.sql)\n\t\trake db:database_dump ignore_tables='messages,incidents'\t\t\t#Dump file with certain tables ignored (useful when generating multiple dumps and concatenating)\n\t\trake db:database_dump additional_params='-d,-t'\t\t\t\t\t\t#Pass in any additional parameters that your database accepts (eg. mysqldump --help / pg_dump --help)\n\nrake db:database_dump RAIlS_ENV=live_export ignore_tables='messages,incidents,entities' additional_params='-d,-t'\nCreate a database dump of the environment in a specified or default location for loading later (or just as a backup file). This will overwrite any file by the same name, so if used for backup specify a unique filename.\n\n\t\trake db:database_load\t\t\t\t\t\t\t\t\t\t\t\t#Load default bootstrap file ( db/bootstrap/bootstrap\\_data.sql)\n\t\trake db:database_load file=db/bootstrap/live_database_dump.sql\t\t#Load the sql dump file specified\n\nLoad, and overwrite, current database environment with a passed file name.\n\nPass 'display=true' if you'd like to see the command being output to your database. For example:\n    rake db:database_dump display=true\n\n### Bootstrap - Reset Application\n\t\trake db:reset_app \t\t\t\t\t\t\t\t\t\t\t\t\t#Reset the application to bootstrap data dump\n\t\trake db:reset_app file=db/bootstrap/live_database_dump.sql      \t#Reset the application to specified database dump\n\nFor a clean start to your app, or a move back to a specified snapshot and then to have migrations run upon the data. Very useful for testing migrations on a production database snapshot. This process will:\n\n * Drop current database tables for current environment\n * Create all tables\n * Load default bootstrap database file or specified file in 'file' parameter\n * Apply migrations from the point of the database snapshot\n\n### Bootstrap - RSPEC Integration\n\nTo enable specs to be loaded from an SQL dump, with migrations, edit your rspec.rake file and alter the spec\\_prereq variable to run the following rake command: db:test:custom\\_prepare (instead of db:test:prepare). With this you can run with a default data set, or your complete data set for thorough testing purposes simply by running : rake spec.\nYou can also load a different 'custom' spec database by running with the file parameter.\neg. rake spec file=db/bootstrap/my_spec_fixtures.sql\n\n### Bootstrap - Database Backup\n\t\trake db:database_backup \t\t\t\t\t\t\t\t\t\t\t\t\t  #Backup the database to default location ('/db/backups'), to a maximum of 5 files\n\t\trake db:database_backup total_backups=2      \t      #Maintain only a maximum of 2 backup files (keep most recent)\n\t\trake db:database_backup backup_location=db/custom_location/save_here  #Set the backup location to a custom location\n\nThis task will save a database dump to a folder, and maintain a set number. Default is 5. This is best paired with a cron task to run at regular intervals.\n\n### Bootstrap - Data Extractors (BETA)\n\t\trake db:extract_data_migrations\n\t\trake db:extract_data_migrations table=users\n\nExtract existing data from all database tables or a specified table into a generated migration file. Can be useful for having effective rollback statements when deleting records. Generated migrations are saved into : \"#{RAILS\\_ROOT}/tmp/generated\\_migrations\".\n\n\t\trake db:extract_fixtures\n\nCurrent contents of the database is extracted into numbered yml files, able to be processed by \"rake db:bootstrap:load\" command. YML files are saved : \"#{RAILS\\_ROOT}/tmp/generated\\_ymls\" and will need to be moved to default bootstrap directory when satisifed with ordering.\n\n## Requirements\n\n * ActiveRecord / DataMapper\n * config/database.yml exists and set correctly\n * database.yml has a 'host' value set for environments\n * mysql/postgres/postgresql - for database dump/load\n\nCopyright (c) 2009 Tom Meier, released under the MIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommeier%2Fbootstrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommeier%2Fbootstrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommeier%2Fbootstrap/lists"}