2017 © Pedro Peláez
 

symfony-bundle rumble

A DynamoDB migration bundle for Symfony 4

image

matasarei/rumble

A DynamoDB migration bundle for Symfony 4

  • Friday, June 1, 2018
  • by matasarei
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Rumble

A DynamoDB migration bundle for Symfony 4 based on original Rumble lib., (*1)

Class definition

  • Migration: Every migration file (class) you create must extend the rumble Migration class and must define an up method.
  • Seed: Every seed file (class) you create must extend the rumble Seeder class and must define a seed method.

Using Rumble

  • Migration: to apply migrations, run ./bin/console rumble:migrate
  • Seed: to execute seed files, run ./bin/console rumble:seed

Supported DynamoDB features

Currently, rumble supports only the below dynamodb features: - Create table - Update table - Delete table - Add Item - Batch Write Item, (*2)

Installation

  1. Add bundle to your project: composer require matasarei/rumble
  2. Add config file: config/packages/rumble.yaml, (*3)

    With default content:, (*4)

     rumble:
         migrations_dir: 'migrations' # <project_root>/migrations/... (optional)
         seeds_dir: 'seeds' # <project_root>/seeds/... (optional)
         version: '2012-08-10' # (default, optional)
         region: 'dev'
         key: 'dev'
         secret: 'dev'
         endpoint: 'http://dynamodb:8000'
    

    You can also override values by adding additional configurations to:, (*5)

    • config/packages/dev/rumble.yaml for dev environment;
    • config/packages/test/rumble.yaml for test \ qa environment;
    • config/packages/prod/rumble.yaml for prod environment.

Create a new table

<?php
// migrations/CreateAppRecordsTable.php

use Matasar\Bundle\Rumble\Migration;

class CreateAppRecordsTable extends Migration
{
    public function up()
    {
        $table = $this->table('test_table'); // table name.
        $table->addAttribue('test_field', 'S'); // primary key data type - String (S)
        $table->addHash('test_field');
        $table->setWCU(1); // Write Capacity Unit (Provisioned write throughput)
        $table->setRCU(1); // Read Capacity Unit (Provisioned read throughput)
        $table->create();
    }
}

You can change write \ read capacity later in table settings \ DynamoDB console or setup auto scaling., (*6)

Seed table

```php <?php // seeds/CreateAppRecordsTable.php, (*7)

use Matasar\Bundle\Rumble\Seeder;, (*8)

class AppRecordsTableSeeder extends Seeder { public function seed() { $table = $this->table('test_table'); $table->addItem(['test_field' => 'First record']); $table->addItem(['test_field' => 'Second record']); $table->save(); } }, (*9)

The Versions

01/06 2018

dev-master

9999999-dev

A DynamoDB migration bundle for Symfony 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lawrence Enehizena
by Yevhen Matasar

php migration dynamodb

01/06 2018

4.0

4.0.0.0

A DynamoDB migration bundle for Symfony 4

  Sources   Download

MIT

The Requires

 

The Development Requires

by Lawrence Enehizena
by Yevhen Matasar

php migration dynamodb