mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Issue #1256: restrict altering existing SQLite tables, apart from a few things
This commit is contained in:
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: HeidiSQL\n"
|
||||
"POT-Creation-Date: 2012-11-05 21:40\n"
|
||||
"PO-Revision-Date: 2022-02-22 21:16+0100\n"
|
||||
"PO-Revision-Date: 2022-04-22 13:06+0200\n"
|
||||
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
||||
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -6709,3 +6709,6 @@ msgstr "Connection failed"
|
||||
|
||||
msgid "Disable foreign key checks"
|
||||
msgstr "Disable foreign key checks"
|
||||
|
||||
msgid "Altering tables restricted. For details see %s"
|
||||
msgstr "Altering tables restricted. For details see %s"
|
||||
|
||||
@@ -212,6 +212,7 @@ type
|
||||
FDeletedKeys,
|
||||
FDeletedForeignKeys,
|
||||
FDeletedCheckConstraints: TStringList;
|
||||
FAlterRestrictedMessageDisplayed: Boolean;
|
||||
procedure ValidateColumnControls;
|
||||
procedure ValidateIndexControls;
|
||||
procedure MoveFocusedIndexPart(NewIdx: Cardinal);
|
||||
@@ -253,6 +254,7 @@ begin
|
||||
FDeletedCheckConstraints := TStringList.Create;
|
||||
FDeletedCheckConstraints.Duplicates := dupIgnore;
|
||||
editName.MaxLength := NAME_LEN;
|
||||
FAlterRestrictedMessageDisplayed := False;
|
||||
end;
|
||||
|
||||
|
||||
@@ -1257,6 +1259,20 @@ begin
|
||||
9: Result := not chkCharsetConvert.Checked;
|
||||
else Result := True;
|
||||
end;
|
||||
|
||||
// SQLite does not support altering existing columns, except renaming. See issue #1256
|
||||
if ObjectExists and DBObject.Connection.Parameters.IsAnySQLite then begin
|
||||
if Col.Status in [esUntouched, esModified, esDeleted] then begin
|
||||
Result := Result and (Column = 1);
|
||||
if (not Result) and (not FAlterRestrictedMessageDisplayed) then begin
|
||||
MainForm.LogSQL(
|
||||
f_('Altering tables restricted. For details see %s', ['https://www.sqlite.org/lang_altertable.html#making_other_kinds_of_table_schema_changes']),
|
||||
lcInfo
|
||||
);
|
||||
FAlterRestrictedMessageDisplayed := True;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user