summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-21 19:36:42 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-21 19:36:42 +0100
commit856ead0e4bc25be5dc6c770fc8da8aade2d83e12 (patch)
tree0638fde3a3e11b2c54845ae8e65f63e29cd1216f /admin
parent4ba9b3906b27e3571767689d2764b67dfe007e30 (diff)
downloadstock-856ead0e4bc25be5dc6c770fc8da8aade2d83e12.tar.gz
stock-856ead0e4bc25be5dc6c770fc8da8aade2d83e12.tar.bz2
stock-856ead0e4bc25be5dc6c770fc8da8aade2d83e12.zip
Rename schema: gallery→assembly, image→component throughout
Tables: stock_gallery→stock_assembly, stock_image→stock_component, stock_gallery_image_map→stock_assembly_component_map. Columns, indices, sequences, preferences and permissions updated to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'admin')
-rwxr-xr-xadmin/schema_inc.php70
1 files changed, 34 insertions, 36 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index 8491977..1e7006f 100755
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -2,24 +2,24 @@
$tables = [
-'stock_gallery' => "
- gallery_id I4 PRIMARY,
+'stock_assembly' => "
+ assembly_id I4 PRIMARY,
content_id I4,
rows_per_page I4,
cols_per_page I4,
thumbnail_size C(32),
preview_content_id I4,
- image_comment C(1)
+ component_comment C(1)
",
-'stock_gallery_image_map' => "
- gallery_content_id I4 NOTNULL,
+'stock_assembly_component_map' => "
+ assembly_content_id I4 NOTNULL,
item_content_id I4 NOTNULL,
item_position F
",
-'stock_image' => "
- image_id I4 PRIMARY,
+'stock_component' => "
+ component_id I4 PRIMARY,
content_id I4 NOTNULL,
photo_date I8,
width I4,
@@ -34,22 +34,22 @@ foreach( array_keys( $tables ) AS $tableName ) {
}
$indices = [
- 'stock_gallery_id_idx' => [ 'table' => 'stock_gallery', 'cols' => 'gallery_id', 'opts' => null ],
- 'stock_gallery_content_idx' => [ 'table' => 'stock_gallery', 'cols' => 'content_id', 'opts' => [ 'UNIQUE' ] ],
- 'stock_image_id_idx' => [ 'table' => 'stock_image', 'cols' => 'image_id', 'opts' => null ],
- 'stock_image_content_idx' => [ 'table' => 'stock_image', 'cols' => 'content_id', 'opts' => [ 'UNIQUE' ] ],
+ 'stock_assembly_id_idx' => [ 'table' => 'stock_assembly', 'cols' => 'assembly_id', 'opts' => null ],
+ 'stock_assembly_content_idx' => [ 'table' => 'stock_assembly', 'cols' => 'content_id', 'opts' => [ 'UNIQUE' ] ],
+ 'stock_component_id_idx' => [ 'table' => 'stock_component', 'cols' => 'component_id', 'opts' => null ],
+ 'stock_component_content_idx'=> [ 'table' => 'stock_component', 'cols' => 'content_id', 'opts' => [ 'UNIQUE' ] ],
];
$gBitInstaller->registerSchemaIndexes( STOCK_PKG_NAME, $indices );
$gBitInstaller->registerPackageInfo( STOCK_PKG_NAME, [
- 'description' => "FishEye is a package for creating image galleries",
+ 'description' => "Stock is a package for managing manufacturing assemblies and components",
'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
] );
// ### Sequences
$sequences = [
- 'stock_gallery_id_seq' => [ 'start' => 1 ],
- 'stock_image_id_seq' => [ 'start' => 1 ],
+ 'stock_assembly_id_seq' => [ 'start' => 1 ],
+ 'stock_component_id_seq' => [ 'start' => 1 ],
];
$gBitInstaller->registerSchemaSequences( STOCK_PKG_NAME, $sequences );
@@ -61,33 +61,32 @@ $gBitInstaller->registerPreferences( STOCK_PKG_NAME, [
[ STOCK_PKG_NAME, 'stock_list_hits','y'],
[ STOCK_PKG_NAME, 'stock_list_thumbnail','y'],
[ STOCK_PKG_NAME, 'stock_list_thumbnail_size','small'],
- [ STOCK_PKG_NAME, 'stock_gallery_list_title','y'],
- [ STOCK_PKG_NAME, 'stock_gallery_list_description','y'],
- [ STOCK_PKG_NAME, 'stock_gallery_list_image_titles','y'],
- [ STOCK_PKG_NAME, 'stock_gallery_default_rows_per_page','5'],
- [ STOCK_PKG_NAME, 'stock_gallery_default_cols_per_page','3'],
- [ STOCK_PKG_NAME, 'stock_gallery_default_thumbnail_size','small'],
- [ STOCK_PKG_NAME, 'stock_image_list_title','y'],
- [ STOCK_PKG_NAME, 'stock_image_list_description','y'],
- [ STOCK_PKG_NAME, 'stock_image_default_thumbnail_size','medium'],
- [ STOCK_PKG_NAME, 'stock_menu_text','Image Galleries'],
- // more intuitive if we can see all galleries we can upload images to
+ [ STOCK_PKG_NAME, 'stock_assembly_list_title','y'],
+ [ STOCK_PKG_NAME, 'stock_assembly_list_description','y'],
+ [ STOCK_PKG_NAME, 'stock_assembly_list_component_titles','y'],
+ [ STOCK_PKG_NAME, 'stock_assembly_default_rows_per_page','5'],
+ [ STOCK_PKG_NAME, 'stock_assembly_default_cols_per_page','3'],
+ [ STOCK_PKG_NAME, 'stock_assembly_default_thumbnail_size','small'],
+ [ STOCK_PKG_NAME, 'stock_component_list_title','y'],
+ [ STOCK_PKG_NAME, 'stock_component_list_description','y'],
+ [ STOCK_PKG_NAME, 'stock_component_default_thumbnail_size','medium'],
+ [ STOCK_PKG_NAME, 'stock_menu_text','Stock Assemblies'],
[ STOCK_PKG_NAME, 'stock_show_public_on_upload','n'],
[ STOCK_PKG_NAME, 'stock_show_all_to_admins','n'],
] );
// ### Default User Permissions
$gBitInstaller->registerUserPermissions( STOCK_PKG_NAME, [
- ['p_stock_list_galleries', 'Can list image galleries', 'basic', STOCK_PKG_NAME],
- ['p_stock_view', 'Can view image galleries', 'basic', STOCK_PKG_NAME],
- ['p_stock_create', 'Can create an image gallery', 'registered', STOCK_PKG_NAME],
- ['p_stock_update', 'Can update image gallery', 'editors', STOCK_PKG_NAME],
- ['p_stock_upload', 'Can upload images to gallery', 'registered', STOCK_PKG_NAME],
- ['p_stock_admin', 'Can admin image galleries', 'editors', STOCK_PKG_NAME],
- ['p_stock_upload_nonimages', 'Can upload non_image files', 'editors', STOCK_PKG_NAME],
- ['p_stock_change_thumb_size', 'Can set the thumbnail size for a gallery', 'editors', STOCK_PKG_NAME],
- ['p_stock_create_public_gal', 'Can create public galleries any user can load images into', 'editors', STOCK_PKG_NAME],
- ['p_stock_download_gallery_arc',' Can download an archived copy of Stock gallery', 'registered', STOCK_PKG_NAME],
+ ['p_stock_list_assemblies', 'Can list stock assemblies', 'basic', STOCK_PKG_NAME],
+ ['p_stock_view', 'Can view stock assemblies', 'basic', STOCK_PKG_NAME],
+ ['p_stock_create', 'Can create a stock assembly', 'registered', STOCK_PKG_NAME],
+ ['p_stock_update', 'Can update stock assembly', 'editors', STOCK_PKG_NAME],
+ ['p_stock_upload', 'Can upload components to assembly', 'registered', STOCK_PKG_NAME],
+ ['p_stock_admin', 'Can admin stock assemblies', 'editors', STOCK_PKG_NAME],
+ ['p_stock_upload_nonimages', 'Can upload non-image files', 'editors', STOCK_PKG_NAME],
+ ['p_stock_change_thumb_size', 'Can set the thumbnail size for an assembly', 'editors', STOCK_PKG_NAME],
+ ['p_stock_create_public_gal', 'Can create public assemblies any user can load components into', 'editors', STOCK_PKG_NAME],
+ ['p_stock_download_assembly_arc', 'Can download an archived copy of stock assembly', 'registered', STOCK_PKG_NAME],
] );
if( defined( 'RSS_PKG_NAME' )) {
@@ -106,4 +105,3 @@ $gBitInstaller->registerContentObjects( STOCK_PKG_NAME, [
$gBitInstaller->registerRequirements( STOCK_PKG_NAME, [
'liberty' => [ 'min' => '5.0.0' ],
]);
-