PHP code example of freitasmurillo / dynamodb-migration
1. Go to this page and download the library: Download freitasmurillo/dynamodb-migration library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
freitasmurillo / dynamodb-migration example snippets
use Rumble\Migration;
class CreateAppRecordsTable extends Migration
{
public function up()
{
$table = $this->table('app_records'); //table name
$table->addAttribute('app_uid', 'S'); //primary key data type - String(S)
$table->addHash('app_uid'); //primary key
$table->setWCU(10); //Write Capacity Unit (Provisioned write throughPut)
$table->setRCU(10); //Read Capacity Unit (Provisioned read throughPut)
$table->create(); //create table
}
}
use Rumble\Seeder;
class AppRecordsTableSeeder extends Seeder
{
public function seed()
{
$table = $this->table('app_records');
$table->addItem(['app_uid' => 'x435-n956-00jX-u2fX', 'uninstall' => ['reason' => 'Still thinking of one.']]);
$table->addItem(['app_uid' => '944-jjU0-o0Hi-y4hh4', 'events' => ['action' => 'click', 'date' => '2017-04-10']]);
$table->save();
}
}
creat_app_records_table.php
creat_app_records_table.php
create_app_records_table.php
app_records_seeder.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.