Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ export default class Sidebar extends Component {
<ul className="toc_section">
<li>– <a href="#Schema-with">with</a></li>
<li>– <a href="#Schema-withSchema">withSchema</a></li>
<li>– <a href="#Schema-createSchema">createSchema</a></li>
<li>– <a href="#Schema-createSchemaIfNotExists">createSchemaIfNotExists</a></li>
<li>– <a href="#Schema-dropSchema">dropSchema</a></li>
<li>– <a href="#Schema-dropSchemaIfExists">dropSchemaIfExists</a></li>
<li>– <a href="#Schema-createTable">createTable</a></li>
<li>– <a href="#Schema-createTableIfNotExists">createTableIfNotExists</a></li>
<li>– <a href="#Schema-renameTable">renameTable</a></li>
Expand Down
56 changes: 56 additions & 0 deletions sections/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,62 @@ export default [
}
]
},
{
type: "method",
method: "createSchema",
example: "knex.schema.createSchema(schemaName)",
description: "Creates a new schema on the database, only applicable to PostgreSQL.",
children: [
{
type: "runnable",
content: `
knex.schema.createSchema('private')
`
}
]
},
{
type: "method",
method: "createSchemaIfNotExists",
example: "knex.schema.createSchemaIfNotExists(schemaName)",
description: "Creates a new schema on the database if it doesn't exists on the database, only applicable to PostgreSQL.",
children: [
{
type: "runnable",
content: `
knex.schema.createSchemaIfNotExists('private')
`
}
]
},
{
type: "method",
method: "dropSchema",
example: "knex.schema.dropSchema(schemaName)",
description: "Drops a schema, specified by schemaName, only applicable to PostgreSQL.",
children: [
{
type: "runnable",
content: `
knex.schema.dropSchema('private')
`
}
]
},
{
type: "method",
method: "dropSchemaIfExists",
example: "knex.schema.dropSchemaIfExists(schemaName)",
description: "Drops a schema conditionally if the schema exists, specified by schemaName, only applicable to PostgreSQL.",
children: [
{
type: "runnable",
content: `
knex.schema.dropSchemaIfExists('private')
`
}
]
},
{
type: "method",
method: "createTable",
Expand Down