Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy only schema #27

Closed
defaultbr opened this issue Apr 24, 2020 · 2 comments
Closed

Copy only schema #27

defaultbr opened this issue Apr 24, 2020 · 2 comments

Comments

@defaultbr
Copy link

Hello, is there any flag to pass to not copy the data, only the schema?

My use case:

My environments are in different accounts, so i have a account for dev, another for uat and other for prod.

So my first situation is to keep synced the schema from dev to prod (at least for the first creation, for migration i should think in another job)

Than after that, i will create a cron job to sync data down, bring data from prod to uat and than to dev

if your lib can replicate only the schema, i can use it for both cases.

Today im using .json schema template and calling aws cli to create the table, it works, but i'm looking for a more robust or better way

@enGMzizo
Copy link
Owner

Yes , I added this feature to copy schema only

var copy = require('copy-dynamodb-table').copy

copy({
    source: {
      tableName: 'source_table_name', 
    },
    destination: {
      tableName: 'destination_table_name', 
    },
    log: true, 
    create : true ,
    schemaOnly : true // copy schema only  < ------- HERE
  },
  function (err, result) {
    if (err) {
      console.log(err)
    }
    console.log(result)
  })

@defaultbr
Copy link
Author

AWESOME!

Will try, thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants