crm-summit/app/Database/Migrations/2026-04-27-000002_AddLabelDescriptionToFigmaVersions.php
mahdahar 329e4e6725 feat(figma): add local sync dashboard, API, and CLI tooling
Add Figma persistence and sync flow for one file source.

- create figma_files, figma_file_versions, and figma_comments tables with supporting migrations
- add FigmaSyncService for full and incremental sync, API fetch, pagination, dedupe, and upserts
- add CLI commands and shell wrappers for full and incremental sync runs
- expose Figma dashboard plus API endpoints for summary, snapshots, comments, and admin sync trigger
- wire route and sidebar entry for dashboard access
- trim legacy file_url and thumbnail_url fields, add version label/description support
2026-04-27 16:55:43 +07:00

44 lines
907 B
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddLabelDescriptionToFigmaVersions extends Migration
{
public function up()
{
$fields = [];
if (!$this->db->fieldExists('label', 'figma_file_versions')) {
$fields['label'] = [
'type' => 'VARCHAR',
'constraint' => 255,
'null' => true,
];
}
if (!$this->db->fieldExists('description', 'figma_file_versions')) {
$fields['description'] = [
'type' => 'LONGTEXT',
'null' => true,
];
}
if (!empty($fields)) {
$this->forge->addColumn('figma_file_versions', $fields);
}
}
public function down()
{
if ($this->db->fieldExists('description', 'figma_file_versions')) {
$this->forge->dropColumn('figma_file_versions', 'description');
}
if ($this->db->fieldExists('label', 'figma_file_versions')) {
$this->forge->dropColumn('figma_file_versions', 'label');
}
}
}