'Create the DB
The storage_policy_index is passed through to the subclass\'s
``_initialize`` method.  It is ignored by ``AccountBroker``.
:param put_timestamp: internalized timestamp of initial PUT request
:param storage_policy_index: only required for containers'

def initialize(self, put_timestamp=None, storage_policy_index=None):

    if (self.db_file == ':memory:'):
        tmp_db_file = None
        conn = get_db_connection(self.db_file, self.timeout)
    else:
        mkdirs(self.db_dir)
        (fd, tmp_db_file) = mkstemp(suffix='.tmp', dir=self.db_dir)
        os.close(fd)
        conn = sqlite3.connect(tmp_db_file, check_same_thread=False, factory=GreenDBConnection, timeout=0)
    with closing(conn.cursor()) as cur:
        cur.execute('PRAGMA    synchronous    =    OFF')
        cur.execute('PRAGMA    temp_store    =    MEMORY')
        cur.execute('PRAGMA    journal_mode    =    MEMORY')
    conn.create_function('chexor', 3, chexor)
    conn.row_factory = sqlite3.Row
    conn.text_factory = str
    conn.executescript("\n                                                CREATE    TABLE    outgoing_sync    (\n                                                                remote_id    TEXT    UNIQUE,\n                                                                sync_point    INTEGER,\n                                                                updated_at    TEXT    DEFAULT    0\n                                                );\n                                                CREATE    TABLE    incoming_sync    (\n                                                                remote_id    TEXT    UNIQUE,\n                                                                sync_point    INTEGER,\n                                                                updated_at    TEXT    DEFAULT    0\n                                                );\n                                                CREATE    TRIGGER    outgoing_sync_insert    AFTER    INSERT    ON    outgoing_sync\n                                                BEGIN\n                                                                UPDATE    outgoing_sync\n                                                                SET    updated_at    =    STRFTIME('%s',    'NOW')\n                                                                WHERE    ROWID    =    new.ROWID;\n                                                END;\n                                                CREATE    TRIGGER    outgoing_sync_update    AFTER    UPDATE    ON    outgoing_sync\n                                                BEGIN\n                                                                UPDATE    outgoing_sync\n                                                                SET    updated_at    =    STRFTIME('%s',    'NOW')\n                                                                WHERE    ROWID    =    new.ROWID;\n                                                END;\n                                                CREATE    TRIGGER    incoming_sync_insert    AFTER    INSERT    ON    incoming_sync\n                                                BEGIN\n                                                                UPDATE    incoming_sync\n                                                                SET    updated_at    =    STRFTIME('%s',    'NOW')\n                                                                WHERE    ROWID    =    new.ROWID;\n                                                END;\n                                                CREATE    TRIGGER    incoming_sync_update    AFTER    UPDATE    ON    incoming_sync\n                                                BEGIN\n                                                                UPDATE    incoming_sync\n                                                                SET    updated_at    =    STRFTIME('%s',    'NOW')\n                                                                WHERE    ROWID    =    new.ROWID;\n                                                END;\n                                ")
    if (not put_timestamp):
        put_timestamp = Timestamp(0).internal
    self._initialize(conn, put_timestamp, storage_policy_index=storage_policy_index)
    conn.commit()
    if tmp_db_file:
        conn.close()
        with open(tmp_db_file, 'r+b') as fp:
            os.fsync(fp.fileno())
        with lock_parent_directory(self.db_file, self.pending_timeout):
            if os.path.exists(self.db_file):
                raise DatabaseAlreadyExists(self.db_file)
            renamer(tmp_db_file, self.db_file)
        self.conn = get_db_connection(self.db_file, self.timeout)
    else:
        self.conn = conn
