Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gocanto/go-db-seeding
Go DB migrations with easy
https://github.com/gocanto/go-db-seeding
faker golang migrations
Last synced: about 1 month ago
JSON representation
Go DB migrations with easy
- Host: GitHub
- URL: https://github.com/gocanto/go-db-seeding
- Owner: gocanto
- License: mit
- Created: 2022-12-19T08:34:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-19T10:02:18.000Z (about 2 years ago)
- Last Synced: 2024-10-18T20:46:55.735Z (3 months ago)
- Topics: faker, golang, migrations
- Language: Go
- Homepage:
- Size: 67.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Go DB migrations with easy
Simple Go project that allows for Postgres DB migrations and fake data.
### How do I run this code?
- Check the Makefile
- Call the `db.Migrate()` method to execute migrations against your current schema.
- Run `go run main.go` to fake and populate the users table.### Aid commands
- Create DB: `make run-db`
- Inspect DB: `make db-bash`
- Create migrations: `make create-migrations`### DB helper commands
> You need to be in your postgres instance bash command line to
be able to execute these commands.- Initiate the DB session: `make db-bash`
- Login: `psql -U postgres`
- Show dbs: `SELECT datname FROM pg_database;`
- Use db: `\c {db-name}`
- Show tables: `\dt`## Contributing
Please, feel free to fork this repository to contribute to it by submitting a functionalities/bugs-fixes pull request to enhance it.
## License
Please see [License File](https://github.com/gocanto/go-db-seeding/blob/main/LICENSE) for more information.
## How can I thank you?
There are many ways you would be able to support my open source work. There is not a right one to choose, so the choice is yours.
Nevertheless :grinning:, I would propose the following
- :arrow_up: Follow me on [Twitter](https://twitter.com/gocanto).
- :star: Star the repository.
- :handshake: Open a pull request to fix/improve the codebase.
- :writing_hand: Open a pull request to improve the documentation.
- :coffee: Buy me a [coffee](https://github.com/sponsors/gocanto)?> Thank you for reading this far. :blush: