Comments (2)
Adding to this a comment I put as a review for #73
We can make use of the following tool: dbmate. This tool will basically run in a container alongside the database, and will receive the database URL as an environment variable.
This will allow us to create very simple migrations in SQL, by simply using text directives:
-- migrate:up
-- migrate:down
So an example of a migration would be:
-- migrate:up
create table users (
id integer,
name varchar(255),
email varchar(255) not null
);
-- migrate:down
This migration file will be generated using a command (dbmate new create_users_table
) and we will fill it however we see fit.
Then, running the migrations up or down becomes a matter of calling a make
command that will send the instruction to the tool in the container, which will subsequently run it against the database, the command would be something like:
migration-up:
docker exec -v $(PWD)/migrations:/db migrater dbmate up
migration-down:
docker exec -v $(PWD)/migrations:/db migrater dbmate rollback
And to generate new timestamped migrations:
generate_migration:
docker exec -v $(PWD)/migrations:/db migrater dbmate new action_table
from pocket.
@Gustavobelfort Not an immediate priority but this is something we will definitely need and I have a sense you might have some insights on it. It'll cross the boundary of the persistence module implementation and dev tooling
from pocket.
Related Issues (20)
- [IBC] Implement an IBC Wasm client implementation for Tendermint chains
- [Documentation] E2E Relay Validation Documentation HOT 2
- [Documentation] E2E Consensus Orchestration & Validation Documentation HOT 2
- [bug][rpc] querying unconfirmed transactions fails HOT 3
- [P2P] Revisit comments in the CLI broadcast logic
- [Utility] Client should validate relay contents
- [Metrics] Profiling and capacity planning for TestNet release
- [Utility][Consensus] PoS Rewards & Slashing Onboarding & Knowledge Transfer HOT 1
- [Product/Project] Protocol PM Knowledge Transfer & Onboarding HOT 2
- [Consensus] Enforce MinBlockTime at the replicas level HOT 4
- [Core] The Watch Begins HOT 1
- [Utility] Support configuring of acceptable payload format(s) for each service
- [Testing] Remove non-determinism from E2E Consensus Tests HOT 1
- [Utility][Documentation] Add a README section on how to use the portal as a servicer
- [Utility] Deploy a Ganache node to support E2E testing HOT 1
- [Infra][Testing] Update infrastructure to support E2E Test HOT 1
- [Consensus] LocalNet fails to prepare first block when pacemaker_config.manual is false HOT 2
- Identify all other places online (e.g. https://docs.pokt.network/) that may need to be updated an update them HOT 1
- [IBC] Update IBC identifier logic
- Pending: need to create CLI command to save default config generated in a file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pocket.