Browse Source

Обновление файла.

master
Repellent 9 years ago
parent
commit
6af82e33b0
  1. 102
      import/sql.php

102
import/sql.php

@ -1,4 +1,5 @@
<?php
<?php
/**
* AVE.cms - Модуль импорта
@ -18,6 +19,22 @@ $module_sql_update = array();
$module_sql_deinstall[] = "DROP TABLE IF EXISTS CPPREFIX_module_import;";
$module_sql_install[] = "CREATE TABLE CPPREFIX_module_import (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`rub_id` int(10) unsigned NOT NULL,
`parser` varchar(255) NOT NULL,
`docs_disable` enum('0','1') NOT NULL default '0',
`docs_create` enum('0','1') NOT NULL default '0',
`file` varchar(255) NOT NULL,
`monitor` enum('0','1') NOT NULL default '0',
`tags` text NOT NULL,
`fields` longtext NOT NULL,
`time_edited` int(10) unsigned NOT NULL,
`time_run` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$module_sql_install[] = "CREATE TABLE CPPREFIX_module_import (
`id` mediumint(5) unsigned NOT NULL auto_increment,
`import_name` varchar(255) NOT NULL,
@ -27,11 +44,13 @@ $module_sql_install[] = "CREATE TABLE CPPREFIX_module_import (
`import_docs_create` enum('0','1') NOT NULL default '0',
`import_default_file` varchar(255) NOT NULL,
`import_monitor_file` enum('0','1') NOT NULL,
`import_last_update` int(10) unsigned default NULL,
`import_text` longtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
// Обновление модуля
$module_sql_update[] = "
UPDATE
@ -44,4 +63,85 @@ $module_sql_update[] = "
ModuleSysName = '" . $modul['ModuleSysName'] . "'
LIMIT 1;
";
?>
// Name
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_name` `name` varchar(255) NOT NULL;
";
// RubID
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_rub` `rub_id` int(10) unsigned NOT NULL;
";
// Parser
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_parser` `parser` varchar(255) NOT NULL;
";
// Docs off
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_delete_docs` `docs_disable` enum('0','1') NOT NULL default '0';
";
// Docs create
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_docs_create` `docs_create` enum('0','1') NOT NULL default '0';
";
// File
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_default_file` `file` varchar(255) NOT NULL;
";
// Monitor
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_monitor_file` `monitor` enum('0','1') NOT NULL default '0';
";
// Tags
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
ADD
`tags` text NOT NULL
AFTER
`monitor`
";
// Fields
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_text` `fields` LONGTEXT NOT NULL AFTER `tags`;
";
// Time Edit
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
CHANGE
`import_last_update` `time_edited` int(10) unsigned NOT NULL;
";
// LastRun
$module_sql_update[] = "
ALTER TABLE
`CPPREFIX_module_import`
ADD
`time_run` int(10) unsigned NOT NULL
AFTER
`time_edited`
";

Loading…
Cancel
Save