Way to drop a table?

20 views
Skip to first unread message

Kenneth Hoffmann

unread,
Sep 25, 2013, 4:52:26 PM9/25/13
to ceq...@googlegroups.com
Specifically looking at a testing scenario. As the test starts, I can call synchronize_schema to make sure the table is created, but I haven't found a way to destroy the table so I can guarantee cleared data for the test. Right now, I'm confining myself to a single partition key in the test and clearing out the row each run.

Matthew A. Brown

unread,
Sep 25, 2013, 5:54:26 PM9/25/13
to Kenneth Hoffmann, ceq...@googlegroups.com
The Record interface doesn't give you a direct way to drop a table (I don't think that would make sense, though I'm open to persuasion) – you can just use the direct schema interface:

    Cequel::Record.connection.schema.drop_table(:table_name)

Hope that helps!


On Wed, Sep 25, 2013 at 4:52 PM, Kenneth Hoffmann <ken...@backupify.com> wrote:
Specifically looking at a testing scenario. As the test starts, I can call synchronize_schema to make sure the table is created, but I haven't found a way to destroy the table so I can guarantee cleared data for the test. Right now, I'm confining myself to a single partition key in the test and clearing out the row each run.

--
You received this message because you are subscribed to the Google Groups "Cequel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cequel+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Kenneth Hoffmann

unread,
Sep 26, 2013, 9:35:46 AM9/26/13
to ceq...@googlegroups.com, Kenneth Hoffmann
Very helpful, thank you!
Reply all
Reply to author
Forward
0 new messages