Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit c65f35e3
authored
Jan 04, 2014
by
Mick Hansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
just one renameTable query
1 parent
6132bcc5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
20 deletions
lib/dialects/abstract/query-generator.js
lib/dialects/mysql/query-generator.js
lib/dialects/postgres/query-generator.js
lib/dialects/sqlite/query-generator.js
lib/dialects/abstract/query-generator.js
View file @
c65f35e
...
...
@@ -35,8 +35,12 @@ module.exports = (function() {
- originalTableName: Name of the table before execution.
- futureTableName: Name of the table after execution.
*/
renameTableQuery
:
function
(
originalTableName
,
futureTableName
)
{
throwMethodUndefined
(
'renameTableQuery'
)
renameTableQuery
:
function
(
before
,
after
)
{
var
query
=
"ALTER TABLE <%= before %> RENAME TO <%= after %>;"
return
Utils
.
_
.
template
(
query
)({
before
:
this
.
quoteTable
(
before
),
after
:
this
.
quoteTable
(
after
)
})
},
/*
...
...
lib/dialects/mysql/query-generator.js
View file @
c65f35e
...
...
@@ -99,11 +99,6 @@ module.exports = (function() {
})
},
renameTableQuery
:
function
(
before
,
after
)
{
var
query
=
"RENAME TABLE `<%= before %>` TO `<%= after %>`;"
return
Utils
.
_
.
template
(
query
)({
before
:
before
,
after
:
after
})
},
showTablesQuery
:
function
()
{
return
'SHOW TABLES;'
},
...
...
lib/dialects/postgres/query-generator.js
View file @
c65f35e
...
...
@@ -97,14 +97,6 @@ module.exports = (function() {
})
},
renameTableQuery
:
function
(
before
,
after
)
{
var
query
=
"ALTER TABLE <%= before %> RENAME TO <%= after %>;"
return
Utils
.
_
.
template
(
query
)({
before
:
this
.
quoteIdentifier
(
before
),
after
:
this
.
quoteIdentifier
(
after
)
})
},
showTablesQuery
:
function
()
{
return
"SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';"
},
...
...
lib/dialects/sqlite/query-generator.js
View file @
c65f35e
...
...
@@ -328,11 +328,6 @@ module.exports = (function() {
return
Utils
.
_
.
template
(
sql
,
{
tableName
:
this
.
addSchema
({
tableName
:
tableName
,
options
:
options
})})
},
renameTableQuery
:
function
(
before
,
after
)
{
var
query
=
"ALTER TABLE `<%= before %>` RENAME TO `<%= after %>`;"
return
Utils
.
_
.
template
(
query
,
{
before
:
before
,
after
:
after
})
},
removeColumnQuery
:
function
(
tableName
,
attributes
)
{
attributes
=
this
.
attributesToSQL
(
attributes
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment