'Create a table and associated index for flexible attributes
for the given entity (if they don\'t exist).'

def _make_attribute_table(self, flex_table):

    with self.transaction() as tx:
        tx.script('\n                                                                CREATE    TABLE    IF    NOT    EXISTS    {0}    (\n                                                                                id    INTEGER    PRIMARY    KEY,\n                                                                                entity_id    INTEGER,\n                                                                                key    TEXT,\n                                                                                value    TEXT,\n                                                                                UNIQUE(entity_id,    key)    ON    CONFLICT    REPLACE);\n                                                                CREATE    INDEX    IF    NOT    EXISTS    {0}_by_entity\n                                                                                ON    {0}    (entity_id);\n                                                                '.format(flex_table))
