MySQL export
FileSpin can export Asset data to your MySQL database. To use this feature, create a table named FILE_DATA_V2 table shown below in your database and update your account settings to point to this database.
The database URL to be updated in your account settings should look like this:
mysql://{USER}:{PASSWORD}@{DATABASE_SERVER}:{PORT}/{DATABASE_NAME}?ssl=true
Note that only the assets uploaded by this account will be exported.
CREATE TABLE `FILE_DATA_V2` (
`status` varchar(11) DEFAULT NULL,
`event` varchar(30) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`update_user_id` int(11) NOT NULL,
`id` char(32) NOT NULL,
`name` varchar(200) NOT NULL,
`size` int(11) DEFAULT NULL,
`content_type` varchar(100) DEFAULT NULL,
`checksum` char(40) DEFAULT NULL,
`upload_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`provider` varchar(50) DEFAULT NULL,
`data` text,
`key` varchar(500) NOT NULL,
`bucket` varchar(500) NOT NULL,
`storage_type` varchar(30) DEFAULT NULL,
`conversions` varchar(2000) DEFAULT NULL,
`public` tinyint(1) DEFAULT NULL,
UNIQUE KEY `file_id` (`id`),
KEY `file_name` (`name`),
KEY `user_id` (`user_id`),
KEY `mime_type` (`content_type`),
KEY `status` (`status`)
) CHARSET=utf8;The table structure corresponds to Asset Data format used across FileSpin APIs and Webhook callback payload.
Note
- All asset events will trigger a database export. The target database record will be updated with the latest asset data for all asset events.
- When asset is purged, the target database record will be updated with
file-purgedas the status instatuscolumn. All other column values will be left as-is.