Skip to content

Commit

Permalink
feat: export schema from the provider
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Oct 13, 2019
1 parent adc5c8e commit 4675bc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions adonis-typings/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ declare module '@ioc:Adonis/Lucid/Schema' {
execUp (): Promise<string [] | boolean>
execDown (): Promise<string [] | boolean>
}

const Schema: SchemaConstructorContract
export default Schema
}
6 changes: 6 additions & 0 deletions providers/DatabaseProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@

import { IocContract } from '@adonisjs/fold'

import { Schema } from '../src/Schema'
import { Database } from '../src/Database'
import { Adapter } from '../src/Orm/Adapter'
import { BaseModel } from '../src/Orm/BaseModel'

import {
column,
hasOne,
Expand Down Expand Up @@ -56,6 +58,10 @@ export default class DatabaseServiceProvider {
hasManyThrough,
}
})

this.$container.singleton('Adonis/Lucid/Schema', () => {
return Schema
})
}

public boot () {
Expand Down

0 comments on commit 4675bc2

Please sign in to comment.