@fayz-ai/plugin-inventory 0.9.0-next.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/{InventoryContext.d.ts → context.d.ts} +2 -2
- package/dist/context.d.ts.map +1 -0
- package/dist/data/registries.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/{InventoryPage.d.ts → views/InventoryPage.d.ts} +3 -3
- package/dist/views/InventoryPage.d.ts.map +1 -0
- package/dist/views/ProductCrudForm.d.ts.map +1 -1
- package/dist/views/dashboardWidgets.d.ts +1 -1
- package/dist/views/dashboardWidgets.d.ts.map +1 -1
- package/dist/views/productEntity.d.ts +1 -1
- package/dist/views/productEntity.d.ts.map +1 -1
- package/package.json +5 -7
- package/dist/InventoryContext.d.ts.map +0 -1
- package/dist/InventoryPage.d.ts.map +0 -1
- package/dist/registries.d.ts.map +0 -1
- package/src/InventoryContext.tsx +0 -42
- package/src/InventoryPage.tsx +0 -176
- package/src/README.md +0 -177
- package/src/components/InventoryGeneralSettings.tsx +0 -39
- package/src/components/InventoryOnboarding.tsx +0 -60
- package/src/components/InventorySettings.tsx +0 -27
- package/src/data/index.ts +0 -2
- package/src/data/mock.ts +0 -266
- package/src/data/supabase.ts +0 -361
- package/src/data/tables.ts +0 -10
- package/src/data/types.ts +0 -35
- package/src/index.ts +0 -238
- package/src/lib/tenant.ts +0 -4
- package/src/locales/en.ts +0 -242
- package/src/locales/index.ts +0 -7
- package/src/locales/pt-BR.ts +0 -242
- package/src/migrations/000_plg_rename.sql +0 -27
- package/src/migrations/001_inventory_base.sql +0 -69
- package/src/migrations/002_recipes.sql +0 -34
- package/src/migrations/003_measurement_units.sql +0 -13
- package/src/migrations/index.ts +0 -161
- package/src/registries.ts +0 -111
- package/src/store.ts +0 -127
- package/src/types.ts +0 -256
- package/src/views/DashboardView.tsx +0 -11
- package/src/views/MovementHistoryView.tsx +0 -104
- package/src/views/ProductCrudForm.tsx +0 -104
- package/src/views/ProductListView.tsx +0 -58
- package/src/views/RecipeDetailView.tsx +0 -192
- package/src/views/RecipeFormView.tsx +0 -241
- package/src/views/RecipesView.tsx +0 -106
- package/src/views/StockMovementView.tsx +0 -518
- package/src/views/dashboardWidgets.tsx +0 -101
- package/src/views/productEntity.tsx +0 -124
- /package/dist/{registries.d.ts → data/registries.d.ts} +0 -0
package/src/locales/pt-BR.ts
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
// inventory.* — merged plugin-own + saas-core central i18n
|
|
2
|
-
export const ptBR: Record<string, string> = {
|
|
3
|
-
"inventory.dashboard.activeItems": "Itens ativos",
|
|
4
|
-
"inventory.dashboard.belowMinimum": "Abaixo do mínimo",
|
|
5
|
-
"inventory.dashboard.entries": "Entradas:",
|
|
6
|
-
"inventory.dashboard.exits": "Saídas:",
|
|
7
|
-
"inventory.dashboard.last7Days": "Últimos 7 dias",
|
|
8
|
-
"inventory.dashboard.lowStock": "Estoque Baixo",
|
|
9
|
-
"inventory.dashboard.needRestocking": "Precisam reposição",
|
|
10
|
-
"inventory.dashboard.outOfStock": "Sem Estoque",
|
|
11
|
-
"inventory.dashboard.quickActions": "Ações Rápidas",
|
|
12
|
-
"inventory.dashboard.quickActionsDesc": "Use a barra lateral para registrar entradas, saídas ou gerenciar produtos.",
|
|
13
|
-
"inventory.dashboard.recentActivity": "Atividade Recente",
|
|
14
|
-
"inventory.dashboard.stockValue": "Valor do Estoque",
|
|
15
|
-
"inventory.dashboard.totalProducts": "Total de Produtos",
|
|
16
|
-
"inventory.dashboard.totalValue": "Valor total do estoque",
|
|
17
|
-
"inventory.history.noMovements": "Nenhuma movimentação registrada",
|
|
18
|
-
"inventory.history.searchPlaceholder": "Buscar movimentações...",
|
|
19
|
-
"inventory.history.subtitle": "Todas as movimentações de estoque",
|
|
20
|
-
"inventory.history.title": "Histórico de Estoque",
|
|
21
|
-
"inventory.nav.dashboard": "Painel",
|
|
22
|
-
"inventory.nav.entry": "Entrada",
|
|
23
|
-
"inventory.nav.exit": "Saída",
|
|
24
|
-
"inventory.nav.history": "Histórico",
|
|
25
|
-
"inventory.nav.list": "Lista",
|
|
26
|
-
"inventory.nav.new": "Novo",
|
|
27
|
-
"inventory.nav.products": "Produtos",
|
|
28
|
-
"inventory.nav.stock": "Estoque",
|
|
29
|
-
"inventory.page.newProduct": "Novo Produto",
|
|
30
|
-
"inventory.page.newProductDesc": "Adicionar um produto ao seu catálogo",
|
|
31
|
-
"inventory.page.settingsSubtitle": "Preferências, fornecedores, categorias e unidades",
|
|
32
|
-
"inventory.page.settingsTitle": "Configurações de Estoque",
|
|
33
|
-
"inventory.page.stockEntry": "Entrada de Estoque",
|
|
34
|
-
"inventory.page.stockEntryDesc": "Registrar mercadorias recebidas",
|
|
35
|
-
"inventory.page.stockExit": "Saída de Estoque",
|
|
36
|
-
"inventory.page.stockExitDesc": "Registrar mercadorias usadas ou vendidas",
|
|
37
|
-
"inventory.recipeDetail.active": "Ativa",
|
|
38
|
-
"inventory.recipeDetail.backToList": "Voltar à lista",
|
|
39
|
-
"inventory.recipeDetail.inactive": "Inativa",
|
|
40
|
-
"inventory.recipeDetail.ingredientCount": "Ingredientes",
|
|
41
|
-
"inventory.recipeDetail.ingredientsTitle": "Ingredientes",
|
|
42
|
-
"inventory.recipeDetail.instructions": "Instruções",
|
|
43
|
-
"inventory.recipeDetail.noIngredients": "Nenhum ingrediente definido",
|
|
44
|
-
"inventory.recipeDetail.notFound": "Receita não encontrada",
|
|
45
|
-
"inventory.recipeDetail.prepTime": "Tempo de preparo",
|
|
46
|
-
"inventory.recipeDetail.produces": "Produz",
|
|
47
|
-
"inventory.recipeDetail.recipes": "Receitas",
|
|
48
|
-
"inventory.recipeDetail.yield": "Rendimento",
|
|
49
|
-
"inventory.recipes.createFirst": "Crie sua primeira receita",
|
|
50
|
-
"inventory.recipes.ingredients": "Ingredientes",
|
|
51
|
-
"inventory.recipes.newRecipe": "Nova Receita",
|
|
52
|
-
"inventory.recipes.noRecipes": "Nenhuma receita ainda",
|
|
53
|
-
"inventory.recipes.produces": "Produz:",
|
|
54
|
-
"inventory.recipes.productionFormulas": "{{count}} fórmulas de produção",
|
|
55
|
-
"inventory.recipes.recipesDesc": "Receitas definem como produzir produtos a partir de ingredientes",
|
|
56
|
-
"inventory.recipes.title": "Receitas",
|
|
57
|
-
"inventory.recipes.yield": "Rendimento",
|
|
58
|
-
"inventory.stock.additionalDetails": "Detalhes adicionais (opcional)",
|
|
59
|
-
"inventory.stock.adjustmentDesc": "Correção de contagem",
|
|
60
|
-
"inventory.stock.adjustmentLabel": "Ajuste",
|
|
61
|
-
"inventory.stock.back": "Voltar",
|
|
62
|
-
"inventory.stock.batchNumber": "Número do Lote",
|
|
63
|
-
"inventory.stock.currentStock": "Estoque Atual",
|
|
64
|
-
"inventory.stock.destination": "Destino",
|
|
65
|
-
"inventory.stock.document": "Documento",
|
|
66
|
-
"inventory.stock.documentNumber": "Número do Documento",
|
|
67
|
-
"inventory.stock.entry": "Entrada de Estoque",
|
|
68
|
-
"inventory.stock.entryDesc": "Recebimento de mercadorias",
|
|
69
|
-
"inventory.stock.entryLabel": "Entrada",
|
|
70
|
-
"inventory.stock.exit": "Saída de Estoque",
|
|
71
|
-
"inventory.stock.exitDesc": "Uso ou venda",
|
|
72
|
-
"inventory.stock.exitLabel": "Saída",
|
|
73
|
-
"inventory.stock.expirationDate": "Data de Validade",
|
|
74
|
-
"inventory.stock.fromLocation": "Local de Origem",
|
|
75
|
-
"inventory.stock.locationLabel": "Local",
|
|
76
|
-
"inventory.stock.lossDesc": "Desperdício ou dano",
|
|
77
|
-
"inventory.stock.lossLabel": "Perda",
|
|
78
|
-
"inventory.stock.movement": "Movimentação de Estoque",
|
|
79
|
-
"inventory.stock.movementDetails": "Detalhes da Movimentação",
|
|
80
|
-
"inventory.stock.movementType": "Tipo de movimentação",
|
|
81
|
-
"inventory.stock.next": "Próximo",
|
|
82
|
-
"inventory.stock.notes": "Observações",
|
|
83
|
-
"inventory.stock.product": "Produto",
|
|
84
|
-
"inventory.stock.quantity": "Quantidade *",
|
|
85
|
-
"inventory.stock.quantityLabel": "Quantidade",
|
|
86
|
-
"inventory.stock.reason": "Motivo *",
|
|
87
|
-
"inventory.stock.reasonLabel": "Motivo",
|
|
88
|
-
"inventory.stock.recordMovement": "Registrar Movimentação",
|
|
89
|
-
"inventory.stock.recorded": "Registrado",
|
|
90
|
-
"inventory.stock.recording": "Registrando...",
|
|
91
|
-
"inventory.stock.searchProduct": "Buscar por nome, SKU ou código de barras...",
|
|
92
|
-
"inventory.stock.stepOf": "Etapa {{step}} de 3",
|
|
93
|
-
"inventory.stock.supplier": "Fornecedor",
|
|
94
|
-
"inventory.stock.toLocation": "Local de Destino *",
|
|
95
|
-
"inventory.stock.total": "Total",
|
|
96
|
-
"inventory.stock.totalCost": "Custo Total",
|
|
97
|
-
"inventory.stock.transferDesc": "Entre locais",
|
|
98
|
-
"inventory.stock.transferLabel": "Transferência",
|
|
99
|
-
"inventory.stock.unitCost": "Custo Unitário",
|
|
100
|
-
"inventory.stock.unitCostLabel": "Custo Unitário",
|
|
101
|
-
"inventory.onboarding.welcome": "Bem-vindo ao Estoque",
|
|
102
|
-
"inventory.onboarding.description": "Acompanhe produtos, gerencie níveis de estoque e monitore movimentações do seu negócio.",
|
|
103
|
-
"inventory.onboarding.skip": "Pular configuração",
|
|
104
|
-
"inventory.onboarding.getStarted": "Começar",
|
|
105
|
-
"inventory.onboarding.units.title": "Unidades de Medida",
|
|
106
|
-
"inventory.onboarding.units.description": "Unidades padrão (Unidade, Caixa, Kg, L, etc.) estão prontas. Personalize-as a qualquer momento em Configurações.",
|
|
107
|
-
"inventory.onboarding.locations.title": "Locais de Estoque",
|
|
108
|
-
"inventory.onboarding.locations.description": "Um local de armazenamento padrão foi criado. Adicione mais para controle multi-local.",
|
|
109
|
-
"inventory.onboarding.start": "Começar a usar Estoque",
|
|
110
|
-
"inventory.quickActions.newProduct": "Novo Produto",
|
|
111
|
-
"inventory.quickActions.newProductDesc": "Adicionar um produto ao catálogo",
|
|
112
|
-
"inventory.quickActions.stockEntry": "Entrada de Estoque",
|
|
113
|
-
"inventory.quickActions.stockEntryDesc": "Registrar mercadorias recebidas",
|
|
114
|
-
"inventory.quickActions.stockExit": "Saída de Estoque",
|
|
115
|
-
"inventory.quickActions.stockExitDesc": "Registrar mercadorias usadas ou vendidas",
|
|
116
|
-
"inventory.settingsPage.title": "Configurações de Estoque",
|
|
117
|
-
"inventory.settingsPage.subtitle": "Gerenciar unidades, categorias e locais de estoque",
|
|
118
|
-
"inventory.settings.stockManagement": "Gestão de Estoque",
|
|
119
|
-
"inventory.settings.stockManagementDesc": "Como os níveis de estoque são rastreados",
|
|
120
|
-
"inventory.settings.lowStockAlerts": "Alertas de estoque baixo",
|
|
121
|
-
"inventory.settings.lowStockAlertsDesc": "Mostrar avisos quando produtos ficarem abaixo da quantidade mínima",
|
|
122
|
-
"inventory.settings.requireReason": "Exigir motivo para ajustes",
|
|
123
|
-
"inventory.settings.requireReasonDesc": "Tornar obrigatório o motivo para ajustes e perdas de estoque",
|
|
124
|
-
"inventory.settings.autoDeduct": "Auto-deduzir no serviço",
|
|
125
|
-
"inventory.settings.autoDeductDesc": "Deduzir automaticamente produtos quando um serviço é executado",
|
|
126
|
-
"inventory.settings.products": "Produtos",
|
|
127
|
-
"inventory.settings.productsDesc": "Comportamento do catálogo de produtos",
|
|
128
|
-
"inventory.settings.requireSku": "Exigir SKU",
|
|
129
|
-
"inventory.settings.requireSkuDesc": "Tornar SKU obrigatório ao criar produtos",
|
|
130
|
-
"inventory.settings.allowNegative": "Permitir estoque negativo",
|
|
131
|
-
"inventory.settings.allowNegativeDesc": "Permitir que quantidades de estoque fiquem abaixo de zero",
|
|
132
|
-
"inventory.settings.notifications": "Notificações",
|
|
133
|
-
"inventory.settings.notificationsDesc": "Alertas e lembretes",
|
|
134
|
-
"inventory.settings.lowStockEmail": "Alertas de estoque baixo por e-mail",
|
|
135
|
-
"inventory.settings.lowStockEmailDesc": "Enviar e-mail quando produtos atingirem a quantidade mínima",
|
|
136
|
-
"inventory.settings.expiryWarnings": "Avisos de validade",
|
|
137
|
-
"inventory.settings.expiryWarningsDesc": "Alertar antes de produtos vencerem (rastreamento de lotes)",
|
|
138
|
-
"inventory.productForm.newProduct": "Novo Produto",
|
|
139
|
-
"inventory.productForm.editProduct": "Editar Produto",
|
|
140
|
-
"inventory.productForm.updateDetails": "Atualizar detalhes do produto",
|
|
141
|
-
"inventory.productForm.addToCatalog": "Adicionar um produto ao seu catálogo",
|
|
142
|
-
"inventory.productForm.cancel": "Cancelar",
|
|
143
|
-
"inventory.productForm.save": "Salvar",
|
|
144
|
-
"inventory.productForm.saving": "Salvando...",
|
|
145
|
-
"inventory.productForm.generalInfo": "Informações Gerais",
|
|
146
|
-
"inventory.productForm.name": "Nome",
|
|
147
|
-
"inventory.productForm.namePlaceholder": "Nome do produto",
|
|
148
|
-
"inventory.productForm.brand": "Marca",
|
|
149
|
-
"inventory.productForm.brandPlaceholder": "Nome da marca",
|
|
150
|
-
"inventory.productForm.sku": "SKU",
|
|
151
|
-
"inventory.productForm.skuPlaceholder": "Código interno",
|
|
152
|
-
"inventory.productForm.barcode": "Código de Barras",
|
|
153
|
-
"inventory.productForm.barcodePlaceholder": "EAN / UPC",
|
|
154
|
-
"inventory.productForm.description": "Descrição",
|
|
155
|
-
"inventory.productForm.descriptionPlaceholder": "Informações adicionais sobre o produto",
|
|
156
|
-
"inventory.productForm.classification": "Classificação",
|
|
157
|
-
"inventory.productForm.classificationDesc": "Como este produto é usado no seu negócio",
|
|
158
|
-
"inventory.productForm.typeIngredient": "Matéria-prima usada na produção ou serviços",
|
|
159
|
-
"inventory.productForm.typeSale": "Vendido diretamente aos clientes",
|
|
160
|
-
"inventory.productForm.typeIntermediate": "Produzido internamente a partir de outros itens",
|
|
161
|
-
"inventory.productForm.typeAsset": "Ativo fixo para controle patrimonial",
|
|
162
|
-
"inventory.productForm.pricing": "Preços",
|
|
163
|
-
"inventory.productForm.costPrice": "Preço de Custo",
|
|
164
|
-
"inventory.productForm.salePrice": "Preço de Venda",
|
|
165
|
-
"inventory.productForm.margin": "Margem",
|
|
166
|
-
"inventory.productForm.stockLevels": "Níveis de Estoque",
|
|
167
|
-
"inventory.productForm.stockLevelsDesc": "Limites mínimo e máximo para alertas",
|
|
168
|
-
"inventory.productForm.minQuantity": "Quantidade Mínima",
|
|
169
|
-
"inventory.productForm.minQuantityHint": "Alertar quando o estoque ficar abaixo deste valor",
|
|
170
|
-
"inventory.productForm.maxQuantity": "Quantidade Máxima",
|
|
171
|
-
"inventory.productForm.maxQuantityHint": "Capacidade máxima para este produto",
|
|
172
|
-
"inventory.productForm.optional": "Opcional",
|
|
173
|
-
"inventory.productList.title": "Produtos",
|
|
174
|
-
"inventory.productList.subtitle": "{{count}} produtos",
|
|
175
|
-
"inventory.productList.product": "Produto",
|
|
176
|
-
"inventory.productList.type": "Tipo",
|
|
177
|
-
"inventory.productList.stock": "Estoque",
|
|
178
|
-
"inventory.productList.cost": "Custo",
|
|
179
|
-
"inventory.productList.value": "Valor",
|
|
180
|
-
"inventory.productList.searchPlaceholder": "Buscar produtos...",
|
|
181
|
-
"inventory.productList.newProduct": "Novo Produto",
|
|
182
|
-
"inventory.productList.empty": "Nenhum produto ainda",
|
|
183
|
-
"inventory.productList.createFirst": "Crie seu primeiro produto",
|
|
184
|
-
"inventory.stock.unknownProduct": "Produto Desconhecido",
|
|
185
|
-
"inventory.stock.reasonLossPlaceholder": "ex. Vencido, danificado",
|
|
186
|
-
"inventory.stock.reasonAdjustPlaceholder": "ex. Correção de contagem física",
|
|
187
|
-
"inventory.stock.documentPlaceholder": "Nota fiscal, recibo, PO...",
|
|
188
|
-
"inventory.stock.batchPlaceholder": "ex. LOT001",
|
|
189
|
-
"inventory.stock.notesPlaceholder": "Observações adicionais...",
|
|
190
|
-
"inventory.recipeDetail.loading": "Carregando...",
|
|
191
|
-
"inventory.recipeDetail.ingredient": "Ingrediente",
|
|
192
|
-
"inventory.recipeDetail.quantity": "Quantidade",
|
|
193
|
-
"inventory.recipeDetail.unit": "Unidade",
|
|
194
|
-
"inventory.recipeDetail.notes": "Observações",
|
|
195
|
-
"inventory.recipeDetail.created": "Criado",
|
|
196
|
-
"inventory.recipeDetail.updated": "Atualizado",
|
|
197
|
-
"inventory.recipeForm.newRecipe": "Nova Receita",
|
|
198
|
-
"inventory.recipeForm.subtitle": "Definir uma fórmula de produção",
|
|
199
|
-
"inventory.recipeForm.cancel": "Cancelar",
|
|
200
|
-
"inventory.recipeForm.saveRecipe": "Salvar Receita",
|
|
201
|
-
"inventory.recipeForm.saving": "Salvando...",
|
|
202
|
-
"inventory.recipeForm.recipeDetails": "Detalhes da Receita",
|
|
203
|
-
"inventory.recipeForm.recipeName": "Nome da Receita",
|
|
204
|
-
"inventory.recipeForm.recipeNamePlaceholder": "ex. Molho de Tomate",
|
|
205
|
-
"inventory.recipeForm.description": "Descrição",
|
|
206
|
-
"inventory.recipeForm.descriptionPlaceholder": "Breve descrição...",
|
|
207
|
-
"inventory.recipeForm.produces": "Produz (Produto)",
|
|
208
|
-
"inventory.recipeForm.searchProduct": "Buscar produto...",
|
|
209
|
-
"inventory.recipeForm.createProduct": "Criar produto",
|
|
210
|
-
"inventory.recipeForm.yieldQuantity": "Quantidade de Rendimento",
|
|
211
|
-
"inventory.recipeForm.prepTime": "Tempo de Preparo (min)",
|
|
212
|
-
"inventory.recipeForm.instructions": "Instruções",
|
|
213
|
-
"inventory.recipeForm.instructionsPlaceholder": "Instruções de preparo passo a passo...",
|
|
214
|
-
"inventory.recipeForm.ingredients": "Ingredientes",
|
|
215
|
-
"inventory.recipeForm.addIngredient": "Adicionar Ingrediente",
|
|
216
|
-
"inventory.recipeForm.noIngredients": "Nenhum ingrediente adicionado",
|
|
217
|
-
"inventory.recipeForm.addFirstIngredient": "Adicione seu primeiro ingrediente",
|
|
218
|
-
"inventory.recipeForm.ingredient": "Ingrediente",
|
|
219
|
-
"inventory.recipeForm.quantity": "Quantidade",
|
|
220
|
-
"inventory.recipeForm.notes": "Observações",
|
|
221
|
-
"inventory.recipeForm.searchIngredient": "Buscar ingrediente...",
|
|
222
|
-
"inventory.recipeForm.createIngredient": "Criar ingrediente",
|
|
223
|
-
"inventory.recipeForm.notesPlaceholder": "ex. picado, fresco",
|
|
224
|
-
"inventory.recipeForm.ingredientsConfigured": "{{configured}} de {{total}} ingredientes configurados",
|
|
225
|
-
"inventory.title": "Estoque",
|
|
226
|
-
"inventory.stock.title": "Estoque",
|
|
227
|
-
"inventory.stock.minStock": "Estoque Mín.",
|
|
228
|
-
"inventory.stock.adjust": "Ajustar Estoque",
|
|
229
|
-
"inventory.stock.lowStock": "Estoque Baixo",
|
|
230
|
-
"inventory.products.title": "Produtos",
|
|
231
|
-
"inventory.products.create": "Novo Produto",
|
|
232
|
-
"inventory.recipes.create": "Nova Receita",
|
|
233
|
-
"inventory.recipes.addIngredient": "Adicionar Ingrediente",
|
|
234
|
-
"inventory.recipes.cost": "Custo",
|
|
235
|
-
"inventory.recipes.loading": "Carregando...",
|
|
236
|
-
"inventory.suppliers.title": "Fornecedores",
|
|
237
|
-
"inventory.suppliers.create": "Novo Fornecedor",
|
|
238
|
-
"inventory.movements.title": "Movimentações",
|
|
239
|
-
"inventory.movements.in": "Entrada",
|
|
240
|
-
"inventory.movements.out": "Saída",
|
|
241
|
-
"inventory.settings.title": "Configurações de Estoque",
|
|
242
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
-- 000_plg_rename.sql — rename legacy inventory tables to plg_inventory_* for pools
|
|
2
|
-
-- provisioned before the industry-pool rename. Guarded: fires only when the legacy
|
|
3
|
-
-- name exists and the target does not, so fresh pools skip every branch.
|
|
4
|
-
DO $$
|
|
5
|
-
BEGIN
|
|
6
|
-
IF to_regclass('public.stock_locations') IS NOT NULL AND to_regclass('public.plg_inventory_stock_locations') IS NULL THEN
|
|
7
|
-
ALTER TABLE public.stock_locations RENAME TO plg_inventory_stock_locations;
|
|
8
|
-
END IF;
|
|
9
|
-
IF to_regclass('public.stock_movements') IS NOT NULL AND to_regclass('public.plg_inventory_stock_movements') IS NULL THEN
|
|
10
|
-
ALTER TABLE public.stock_movements RENAME TO plg_inventory_stock_movements;
|
|
11
|
-
END IF;
|
|
12
|
-
IF to_regclass('public.stock_positions') IS NOT NULL AND to_regclass('public.plg_inventory_stock_positions') IS NULL THEN
|
|
13
|
-
ALTER TABLE public.stock_positions RENAME TO plg_inventory_stock_positions;
|
|
14
|
-
END IF;
|
|
15
|
-
IF to_regclass('public.recipes') IS NOT NULL AND to_regclass('public.plg_inventory_recipes') IS NULL THEN
|
|
16
|
-
ALTER TABLE public.recipes RENAME TO plg_inventory_recipes;
|
|
17
|
-
END IF;
|
|
18
|
-
IF to_regclass('public.recipe_ingredients') IS NOT NULL AND to_regclass('public.plg_inventory_recipe_ingredients') IS NULL THEN
|
|
19
|
-
ALTER TABLE public.recipe_ingredients RENAME TO plg_inventory_recipe_ingredients;
|
|
20
|
-
END IF;
|
|
21
|
-
IF to_regclass('public.measurement_units') IS NOT NULL AND to_regclass('public.plg_inventory_measurement_units') IS NULL THEN
|
|
22
|
-
ALTER TABLE public.measurement_units RENAME TO plg_inventory_measurement_units;
|
|
23
|
-
END IF;
|
|
24
|
-
IF to_regclass('public.product_categories') IS NOT NULL AND to_regclass('public.plg_inventory_product_categories') IS NULL THEN
|
|
25
|
-
ALTER TABLE public.product_categories RENAME TO plg_inventory_product_categories;
|
|
26
|
-
END IF;
|
|
27
|
-
END $$;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
-- Inventory Plugin: Base Tables
|
|
2
|
-
-- Products use public.products archetype directly
|
|
3
|
-
-- These are plugin-specific extension tables
|
|
4
|
-
|
|
5
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_product_categories (
|
|
6
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
7
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
8
|
-
name text NOT NULL,
|
|
9
|
-
parent_id uuid REFERENCES public.plg_inventory_product_categories(id),
|
|
10
|
-
is_active boolean NOT NULL DEFAULT true,
|
|
11
|
-
created_at timestamptz NOT NULL DEFAULT now(),
|
|
12
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
13
|
-
);
|
|
14
|
-
ALTER TABLE public.plg_inventory_product_categories ENABLE ROW LEVEL SECURITY;
|
|
15
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_product_categories_tenant ON public.plg_inventory_product_categories(tenant_id);
|
|
16
|
-
|
|
17
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_stock_locations (
|
|
18
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
19
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
20
|
-
name text NOT NULL,
|
|
21
|
-
description text,
|
|
22
|
-
is_active boolean NOT NULL DEFAULT true,
|
|
23
|
-
unit_id uuid,
|
|
24
|
-
created_at timestamptz NOT NULL DEFAULT now(),
|
|
25
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
26
|
-
);
|
|
27
|
-
ALTER TABLE public.plg_inventory_stock_locations ENABLE ROW LEVEL SECURITY;
|
|
28
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_locations_tenant ON public.plg_inventory_stock_locations(tenant_id);
|
|
29
|
-
|
|
30
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_stock_movements (
|
|
31
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
32
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
33
|
-
product_id uuid NOT NULL REFERENCES public.products(id),
|
|
34
|
-
quantity numeric(14,4) NOT NULL,
|
|
35
|
-
movement_type text NOT NULL,
|
|
36
|
-
unit_cost numeric(14,2) DEFAULT 0,
|
|
37
|
-
total_cost numeric(14,2) DEFAULT 0,
|
|
38
|
-
stock_location_id uuid REFERENCES public.plg_inventory_stock_locations(id),
|
|
39
|
-
destination_location_id uuid REFERENCES public.plg_inventory_stock_locations(id),
|
|
40
|
-
supplier_id uuid REFERENCES public.people(id),
|
|
41
|
-
document_number text,
|
|
42
|
-
reason text,
|
|
43
|
-
notes text,
|
|
44
|
-
movement_date date NOT NULL DEFAULT CURRENT_DATE,
|
|
45
|
-
user_id uuid,
|
|
46
|
-
batch_number text,
|
|
47
|
-
expiration_date date,
|
|
48
|
-
metadata jsonb DEFAULT '{}'::jsonb,
|
|
49
|
-
created_at timestamptz NOT NULL DEFAULT now()
|
|
50
|
-
);
|
|
51
|
-
ALTER TABLE public.plg_inventory_stock_movements ENABLE ROW LEVEL SECURITY;
|
|
52
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_movements_tenant ON public.plg_inventory_stock_movements(tenant_id);
|
|
53
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_movements_product ON public.plg_inventory_stock_movements(product_id);
|
|
54
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_movements_date ON public.plg_inventory_stock_movements(tenant_id, movement_date);
|
|
55
|
-
|
|
56
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_stock_positions (
|
|
57
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
58
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
59
|
-
product_id uuid NOT NULL REFERENCES public.products(id),
|
|
60
|
-
quantity numeric(14,4) NOT NULL,
|
|
61
|
-
unit_cost numeric(14,2) DEFAULT 0,
|
|
62
|
-
stock_location_id uuid REFERENCES public.plg_inventory_stock_locations(id),
|
|
63
|
-
batch_number text,
|
|
64
|
-
expiration_date date,
|
|
65
|
-
created_at timestamptz NOT NULL DEFAULT now()
|
|
66
|
-
);
|
|
67
|
-
ALTER TABLE public.plg_inventory_stock_positions ENABLE ROW LEVEL SECURITY;
|
|
68
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_positions_tenant ON public.plg_inventory_stock_positions(tenant_id);
|
|
69
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_positions_product ON public.plg_inventory_stock_positions(product_id);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
-- Inventory Plugin: Recipes & Technical Specs
|
|
2
|
-
|
|
3
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_recipes (
|
|
4
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
5
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
6
|
-
name text NOT NULL,
|
|
7
|
-
description text,
|
|
8
|
-
product_id uuid REFERENCES public.products(id),
|
|
9
|
-
yield_quantity numeric(14,4) DEFAULT 1,
|
|
10
|
-
yield_unit_id uuid,
|
|
11
|
-
preparation_time_minutes integer,
|
|
12
|
-
instructions text,
|
|
13
|
-
is_active boolean NOT NULL DEFAULT true,
|
|
14
|
-
created_at timestamptz NOT NULL DEFAULT now(),
|
|
15
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
16
|
-
);
|
|
17
|
-
ALTER TABLE public.plg_inventory_recipes ENABLE ROW LEVEL SECURITY;
|
|
18
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_recipes_tenant ON public.plg_inventory_recipes(tenant_id);
|
|
19
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_recipes_product ON public.plg_inventory_recipes(product_id);
|
|
20
|
-
|
|
21
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_recipe_ingredients (
|
|
22
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
23
|
-
recipe_id uuid NOT NULL REFERENCES public.plg_inventory_recipes(id) ON DELETE CASCADE,
|
|
24
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
25
|
-
product_id uuid NOT NULL REFERENCES public.products(id),
|
|
26
|
-
quantity numeric(14,4) NOT NULL,
|
|
27
|
-
unit_id uuid,
|
|
28
|
-
display_order integer DEFAULT 0,
|
|
29
|
-
notes text,
|
|
30
|
-
created_at timestamptz NOT NULL DEFAULT now()
|
|
31
|
-
);
|
|
32
|
-
ALTER TABLE public.plg_inventory_recipe_ingredients ENABLE ROW LEVEL SECURITY;
|
|
33
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_recipe_ingredients_tenant ON public.plg_inventory_recipe_ingredients(tenant_id);
|
|
34
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_recipe_ingredients_recipe ON public.plg_inventory_recipe_ingredients(recipe_id);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
-- Inventory Plugin: Measurement Units
|
|
2
|
-
|
|
3
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_measurement_units (
|
|
4
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
5
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
6
|
-
name text NOT NULL,
|
|
7
|
-
abbreviation text NOT NULL,
|
|
8
|
-
is_active boolean NOT NULL DEFAULT true,
|
|
9
|
-
created_at timestamptz NOT NULL DEFAULT now(),
|
|
10
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
11
|
-
);
|
|
12
|
-
ALTER TABLE public.plg_inventory_measurement_units ENABLE ROW LEVEL SECURITY;
|
|
13
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_measurement_units_tenant ON public.plg_inventory_measurement_units(tenant_id);
|
package/src/migrations/index.ts
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
// AUTO-GENERATED from 000_plg_rename.sql, 001_inventory_base.sql, 002_recipes.sql, 003_measurement_units.sql — regenerate with scripts/embed-migrations.mjs
|
|
2
|
-
// SQL files are the source of truth; this inline copy lets the manifest declare
|
|
3
|
-
// migrations as data. Do not edit by hand — run the embed script instead.
|
|
4
|
-
|
|
5
|
-
export const MIGRATION_000_PLG_RENAME = `-- 000_plg_rename.sql — rename legacy inventory tables to plg_inventory_* for pools
|
|
6
|
-
-- provisioned before the industry-pool rename. Guarded: fires only when the legacy
|
|
7
|
-
-- name exists and the target does not, so fresh pools skip every branch.
|
|
8
|
-
DO $$
|
|
9
|
-
BEGIN
|
|
10
|
-
IF to_regclass('public.stock_locations') IS NOT NULL AND to_regclass('public.plg_inventory_stock_locations') IS NULL THEN
|
|
11
|
-
ALTER TABLE public.stock_locations RENAME TO plg_inventory_stock_locations;
|
|
12
|
-
END IF;
|
|
13
|
-
IF to_regclass('public.stock_movements') IS NOT NULL AND to_regclass('public.plg_inventory_stock_movements') IS NULL THEN
|
|
14
|
-
ALTER TABLE public.stock_movements RENAME TO plg_inventory_stock_movements;
|
|
15
|
-
END IF;
|
|
16
|
-
IF to_regclass('public.stock_positions') IS NOT NULL AND to_regclass('public.plg_inventory_stock_positions') IS NULL THEN
|
|
17
|
-
ALTER TABLE public.stock_positions RENAME TO plg_inventory_stock_positions;
|
|
18
|
-
END IF;
|
|
19
|
-
IF to_regclass('public.recipes') IS NOT NULL AND to_regclass('public.plg_inventory_recipes') IS NULL THEN
|
|
20
|
-
ALTER TABLE public.recipes RENAME TO plg_inventory_recipes;
|
|
21
|
-
END IF;
|
|
22
|
-
IF to_regclass('public.recipe_ingredients') IS NOT NULL AND to_regclass('public.plg_inventory_recipe_ingredients') IS NULL THEN
|
|
23
|
-
ALTER TABLE public.recipe_ingredients RENAME TO plg_inventory_recipe_ingredients;
|
|
24
|
-
END IF;
|
|
25
|
-
IF to_regclass('public.measurement_units') IS NOT NULL AND to_regclass('public.plg_inventory_measurement_units') IS NULL THEN
|
|
26
|
-
ALTER TABLE public.measurement_units RENAME TO plg_inventory_measurement_units;
|
|
27
|
-
END IF;
|
|
28
|
-
IF to_regclass('public.product_categories') IS NOT NULL AND to_regclass('public.plg_inventory_product_categories') IS NULL THEN
|
|
29
|
-
ALTER TABLE public.product_categories RENAME TO plg_inventory_product_categories;
|
|
30
|
-
END IF;
|
|
31
|
-
END $$;
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
export const MIGRATION_001_INVENTORY_BASE = `-- Inventory Plugin: Base Tables
|
|
35
|
-
-- Products use public.products archetype directly
|
|
36
|
-
-- These are plugin-specific extension tables
|
|
37
|
-
|
|
38
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_product_categories (
|
|
39
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
40
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
41
|
-
name text NOT NULL,
|
|
42
|
-
parent_id uuid REFERENCES public.plg_inventory_product_categories(id),
|
|
43
|
-
is_active boolean NOT NULL DEFAULT true,
|
|
44
|
-
created_at timestamptz NOT NULL DEFAULT now(),
|
|
45
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
46
|
-
);
|
|
47
|
-
ALTER TABLE public.plg_inventory_product_categories ENABLE ROW LEVEL SECURITY;
|
|
48
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_product_categories_tenant ON public.plg_inventory_product_categories(tenant_id);
|
|
49
|
-
|
|
50
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_stock_locations (
|
|
51
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
52
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
53
|
-
name text NOT NULL,
|
|
54
|
-
description text,
|
|
55
|
-
is_active boolean NOT NULL DEFAULT true,
|
|
56
|
-
unit_id uuid,
|
|
57
|
-
created_at timestamptz NOT NULL DEFAULT now(),
|
|
58
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
59
|
-
);
|
|
60
|
-
ALTER TABLE public.plg_inventory_stock_locations ENABLE ROW LEVEL SECURITY;
|
|
61
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_locations_tenant ON public.plg_inventory_stock_locations(tenant_id);
|
|
62
|
-
|
|
63
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_stock_movements (
|
|
64
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
65
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
66
|
-
product_id uuid NOT NULL REFERENCES public.products(id),
|
|
67
|
-
quantity numeric(14,4) NOT NULL,
|
|
68
|
-
movement_type text NOT NULL,
|
|
69
|
-
unit_cost numeric(14,2) DEFAULT 0,
|
|
70
|
-
total_cost numeric(14,2) DEFAULT 0,
|
|
71
|
-
stock_location_id uuid REFERENCES public.plg_inventory_stock_locations(id),
|
|
72
|
-
destination_location_id uuid REFERENCES public.plg_inventory_stock_locations(id),
|
|
73
|
-
supplier_id uuid REFERENCES public.people(id),
|
|
74
|
-
document_number text,
|
|
75
|
-
reason text,
|
|
76
|
-
notes text,
|
|
77
|
-
movement_date date NOT NULL DEFAULT CURRENT_DATE,
|
|
78
|
-
user_id uuid,
|
|
79
|
-
batch_number text,
|
|
80
|
-
expiration_date date,
|
|
81
|
-
metadata jsonb DEFAULT '{}'::jsonb,
|
|
82
|
-
created_at timestamptz NOT NULL DEFAULT now()
|
|
83
|
-
);
|
|
84
|
-
ALTER TABLE public.plg_inventory_stock_movements ENABLE ROW LEVEL SECURITY;
|
|
85
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_movements_tenant ON public.plg_inventory_stock_movements(tenant_id);
|
|
86
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_movements_product ON public.plg_inventory_stock_movements(product_id);
|
|
87
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_movements_date ON public.plg_inventory_stock_movements(tenant_id, movement_date);
|
|
88
|
-
|
|
89
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_stock_positions (
|
|
90
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
91
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
92
|
-
product_id uuid NOT NULL REFERENCES public.products(id),
|
|
93
|
-
quantity numeric(14,4) NOT NULL,
|
|
94
|
-
unit_cost numeric(14,2) DEFAULT 0,
|
|
95
|
-
stock_location_id uuid REFERENCES public.plg_inventory_stock_locations(id),
|
|
96
|
-
batch_number text,
|
|
97
|
-
expiration_date date,
|
|
98
|
-
created_at timestamptz NOT NULL DEFAULT now()
|
|
99
|
-
);
|
|
100
|
-
ALTER TABLE public.plg_inventory_stock_positions ENABLE ROW LEVEL SECURITY;
|
|
101
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_positions_tenant ON public.plg_inventory_stock_positions(tenant_id);
|
|
102
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_stock_positions_product ON public.plg_inventory_stock_positions(product_id);
|
|
103
|
-
`
|
|
104
|
-
|
|
105
|
-
export const MIGRATION_002_RECIPES = `-- Inventory Plugin: Recipes & Technical Specs
|
|
106
|
-
|
|
107
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_recipes (
|
|
108
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
109
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
110
|
-
name text NOT NULL,
|
|
111
|
-
description text,
|
|
112
|
-
product_id uuid REFERENCES public.products(id),
|
|
113
|
-
yield_quantity numeric(14,4) DEFAULT 1,
|
|
114
|
-
yield_unit_id uuid,
|
|
115
|
-
preparation_time_minutes integer,
|
|
116
|
-
instructions text,
|
|
117
|
-
is_active boolean NOT NULL DEFAULT true,
|
|
118
|
-
created_at timestamptz NOT NULL DEFAULT now(),
|
|
119
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
120
|
-
);
|
|
121
|
-
ALTER TABLE public.plg_inventory_recipes ENABLE ROW LEVEL SECURITY;
|
|
122
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_recipes_tenant ON public.plg_inventory_recipes(tenant_id);
|
|
123
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_recipes_product ON public.plg_inventory_recipes(product_id);
|
|
124
|
-
|
|
125
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_recipe_ingredients (
|
|
126
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
127
|
-
recipe_id uuid NOT NULL REFERENCES public.plg_inventory_recipes(id) ON DELETE CASCADE,
|
|
128
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
129
|
-
product_id uuid NOT NULL REFERENCES public.products(id),
|
|
130
|
-
quantity numeric(14,4) NOT NULL,
|
|
131
|
-
unit_id uuid,
|
|
132
|
-
display_order integer DEFAULT 0,
|
|
133
|
-
notes text,
|
|
134
|
-
created_at timestamptz NOT NULL DEFAULT now()
|
|
135
|
-
);
|
|
136
|
-
ALTER TABLE public.plg_inventory_recipe_ingredients ENABLE ROW LEVEL SECURITY;
|
|
137
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_recipe_ingredients_tenant ON public.plg_inventory_recipe_ingredients(tenant_id);
|
|
138
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_recipe_ingredients_recipe ON public.plg_inventory_recipe_ingredients(recipe_id);
|
|
139
|
-
`
|
|
140
|
-
|
|
141
|
-
export const MIGRATION_003_MEASUREMENT_UNITS = `-- Inventory Plugin: Measurement Units
|
|
142
|
-
|
|
143
|
-
CREATE TABLE IF NOT EXISTS public.plg_inventory_measurement_units (
|
|
144
|
-
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
145
|
-
tenant_id uuid NOT NULL REFERENCES public.tenants(id) ON DELETE CASCADE,
|
|
146
|
-
name text NOT NULL,
|
|
147
|
-
abbreviation text NOT NULL,
|
|
148
|
-
is_active boolean NOT NULL DEFAULT true,
|
|
149
|
-
created_at timestamptz NOT NULL DEFAULT now(),
|
|
150
|
-
updated_at timestamptz NOT NULL DEFAULT now()
|
|
151
|
-
);
|
|
152
|
-
ALTER TABLE public.plg_inventory_measurement_units ENABLE ROW LEVEL SECURITY;
|
|
153
|
-
CREATE INDEX IF NOT EXISTS idx_plg_inventory_measurement_units_tenant ON public.plg_inventory_measurement_units(tenant_id);
|
|
154
|
-
`
|
|
155
|
-
|
|
156
|
-
export const MIGRATIONS: Array<{ id: string; sql: string }> = [
|
|
157
|
-
{ id: "000_plg_rename", sql: MIGRATION_000_PLG_RENAME },
|
|
158
|
-
{ id: "001_inventory_base", sql: MIGRATION_001_INVENTORY_BASE },
|
|
159
|
-
{ id: "002_recipes", sql: MIGRATION_002_RECIPES },
|
|
160
|
-
{ id: "003_measurement_units", sql: MIGRATION_003_MEASUREMENT_UNITS },
|
|
161
|
-
]
|