Download the PHP package freitasmurillo/dynamodb-migration without Composer
On this page you can find all versions of the php package freitasmurillo/dynamodb-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download freitasmurillo/dynamodb-migration
More information about freitasmurillo/dynamodb-migration
Files in freitasmurillo/dynamodb-migration
Package dynamodb-migration
Short Description A dynamodb migration tool
License MIT
Informations about the package dynamodb-migration
Rumble
A php migration tool for AWS dynamoDB.
Requirements
To use for migration and seeding, you should either have aws dymanodb locally installed or have a valid aws credential for the remote version in a particular aws region.
Disclosure
is far from being complete compared to other migration tool out there. More features will be added in the future.
Naming Convention
Since is still in its infancy, it cannot generate migration or seeder file automatically. You have to manually create files for both migrations and seeds. Migration and Seed files are to be placed in and directories at the root of your project.
A migration or seed file must be named with an underscore separating each word that makes up the file name. e.g: , is a valid file name for a migration or a seed file.
While the file name uses underscore naming style, the class name for the file uses PasCal naming style. i.e the first letter of every word that makes up the file name must be capitalized e.g: .
Class Definition
- Migration: Every migration file (class) you create must extend the rumble class and must define a method.
- Seed: Every seed file (class) you create must extend the rumble class and must define a method.
Using Rumble
- Migration: to migrate files, run from the root directory of your project. e.g:
- Seed: to seed files, run from the root directory of your project e.g
Supported DynamoDb Features
Currently, supports only the below dynamodb features;
- Create table
- Update table
- Delete table
- Add Item
- Batch Write Item
Tutorial - Create a new table
The below code sample shows the minimum required params to create a dynamodb table using . This is from the method of the migration file (). The method, is the only required method to be implemented by every migration file you create.
Tutorial - Seed table
The below sample code shows the minimum required params to seed a dynamodb table (sample created above). This is from the method of the seed file (). The method is the only required method to be implemented by every seed file you create
Database Configuration
uses as its configuration.
These variables don't have any default value so you HAVE to set them all.
I'll show you how to propel configure it to use a local environment.
AWS_ACCESS_KEY_ID=__YOUR_AWS_ID__
AWS_SECRET_ACCESS_KEY=__YOUR_AWS_SECRET__
AWS_DYNAMO_REGION=us-east-1
AWS_DYNAMO_ENDPOINT=http://localhost:8000/
AWS_DYNAMO_VERSION=latest