Skip to content

Instantly share code, notes, and snippets.

@demimismo
Last active December 17, 2015 00:59
Show Gist options
  • Save demimismo/5525507 to your computer and use it in GitHub Desktop.
Save demimismo/5525507 to your computer and use it in GitHub Desktop.
Cartodbfy any existing postgresql table

First of all, open a rails console

bundle exec rails c

And then:

table = Table.new
table.user_id  = # whatever id
table.name     = # name of the existing table
table.table_id = # relation's object identifier
table.migrate_existing_table = # name of the existing table
table.save

See User#link_created_tables for reference: https://github.com/CartoDB/cartodb20/blob/develop/app/models/user.rb#L411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment