cyclist_emails

Create and drop the cyclist emails table with its known ID.

Empty table to demonstrate creating, dropping, and recreating the cyclist_emails table with its original ID so that commit logs can replay properly during restores. Be sure to take note of the table ID, visible in the system_schema table.
SOURCE '0_create_keyspace.cql';

DROP TABLE IF EXISTS cycling.cyclist_emails;

// Create a table with a known table id
// START-ID
CREATE TABLE IF NOT EXISTS cycling.cyclist_emails (
  userid text PRIMARY KEY,
  id UUID,
  emails set<text>
)
WITH ID = '1bb7516e-b140-11e8-96f8-529269fb1459';
// END-ID

// Drop table
DROP TABLE IF EXISTS cycling.cyclist_emails;

// Create table again with a known table id
// START-recreateID
CREATE TABLE IF NOT EXISTS cycling.cyclist_emails (
  userid text PRIMARY KEY,
  id UUID,
  emails set<text>
)
WITH ID = '1bb7516e-b140-11e8-96f8-529269fb1459';
// END-recreateID

// Retrieve the table id
// START-select_id_from_system_schema
SELECT id
FROM system_schema.tables
WHERE keyspace_name = 'cycling'
  AND table_name = 'cyclist_emails';
// END-select_id_from_system_schema