Compare commits

..

25 Commits

Author SHA1 Message Date
Kilian 172128b37b Relations 2021-08-16 11:34:24 +02:00
Kilian 8bb522ec33 Create Exams 2021-08-16 10:36:55 +02:00
Kilian f32d3a4877 MID based exams 2021-08-15 23:24:15 +02:00
Kilian 0fe449538e Grouping issues 2021-08-15 23:06:15 +02:00
Kilian c797cb9f24 Basic schooling GQL 2021-08-15 19:05:54 +02:00
Kilian e884b0e97d Unecrypted Cookie 2021-08-15 13:46:06 +02:00
Kilian 9b153dacd8 Controller Permission 2021-08-14 21:44:41 +02:00
Kilian fdf7e89afe Member FK 2021-08-14 18:28:24 +02:00
Kilian 7baa903f7a Namespace Permission 2021-08-14 14:18:31 +02:00
Kilian 3e0ba5f209 Dynamic host 2021-08-14 13:15:45 +02:00
Kilian a5598130db remove require 2021-08-04 19:51:38 +02:00
Kilian e6ceea1b1b Unused use removed 2021-08-04 19:14:52 +02:00
Your Name 064e8a8054 Formating .htm removed 2021-08-04 12:34:53 +02:00
Your Name 52ecda573b Updated 2021-08-04 01:59:47 +02:00
Your Name a88999cd18 Yarn 2021-08-04 01:54:23 +02:00
Your Name 40d396908d Hooks 2021-08-04 01:30:47 +02:00
Your Name f01509cab1 Format 2021-08-04 00:56:18 +02:00
Your Name 51941b88ee Lockfile 2021-08-04 00:53:59 +02:00
Your Name 222194e554 Key Controller + list 2021-08-04 00:49:21 +02:00
Your Name 78acb54845 Database 2021-08-03 22:32:33 +02:00
Your Name b4ccced253 Database 2021-08-03 22:05:39 +02:00
Your Name 2106f15d7f Naming adjusted for consistency 2021-07-29 01:30:05 +02:00
Your Name 63b8173399 Small Adjustments 2021-07-29 01:26:23 +02:00
Your Name df0f8f36f7 Auth 2021-07-28 22:02:10 +02:00
Your Name a6d844bd01 Mutations 2021-07-28 19:10:35 +02:00
26 changed files with 527 additions and 37 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACMR -- '*.php' '*.html' '*.yaml' | sed 's| |\\ |g')
[ -z "$FILES" ] && exit 0
# Prettify all selected files
echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --write
# Add back the modified/prettified files to staging
echo "$FILES" | xargs git add
exit 0
+15
View File
@@ -4,6 +4,8 @@ use System\Classes\PluginBase;
use App; use App;
use Config; use Config;
use Illuminate\Database\DatabaseManager;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Foundation\AliasLoader; use Illuminate\Foundation\AliasLoader;
use GermanAirlinesVa\Graphql\Classes\GraphqlServiceProvider; use GermanAirlinesVa\Graphql\Classes\GraphqlServiceProvider;
use Nuwave\Lighthouse\Subscriptions\SubscriptionServiceProvider; use Nuwave\Lighthouse\Subscriptions\SubscriptionServiceProvider;
@@ -33,9 +35,22 @@ class Plugin extends PluginBase
public function boot() public function boot()
{ {
App::make('October\Rain\Support\ClassLoader')->addDirectories('graphql'); App::make('October\Rain\Support\ClassLoader')->addDirectories('graphql');
$this->bootPackages(); $this->bootPackages();
App::register(GraphqlServiceProvider::class); App::register(GraphqlServiceProvider::class);
App::register(SubscriptionServiceProvider::class); App::register(SubscriptionServiceProvider::class);
$this->app->singleton(DatabaseManager::class, function ($app) {
return $app->make('db');
});
Broadcast::routes([
'prefix' => '',
'middleware' => 'GermanAirlinesVA\\Graphql\\Classes\\Authentication',
]);
Config::set('database.connections.germanairlinesva_graphql', Config::get('germanairlinesva.graphql::connection'));
Config::push('system.unencrypt_cookies', 'graphql-session-id');
} }
public function bootPackages() public function bootPackages()
+5
View File
@@ -0,0 +1,5 @@
# Relations
## GraphQLKeys
- BelongsTo Member (External DB, creation in Social Plugin)
+1 -1
View File
@@ -32920,7 +32920,7 @@ var _validUrl = __webpack_require__(429);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var options = { method: 'post', headers: { 'Content-Type': 'application/json' } }; var options = { method: 'post', headers: { 'Content-Type': 'application/json' } };
var endpoint = 'http://192.168.64.3/graphql/'; // Initial var endpoint = 'http://' + window.location.host + '/graphql/'; // Initial
var defaultQuery = '\n# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that starts\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n# {\n# field(arg: "value") {\n# subField\n# }\n# }\n#\n# Keyboard shortcuts:\n#\n# Run Query: Ctrl-Enter (or press the play button above)\n#\n# Auto Complete: Ctrl-Space (or just start typing)\n#\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n# Default endpoint is an instance of https://www.graph.cool/\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n\nquery {\n countries {\n name\n }\n}\n'; var defaultQuery = '\n# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that starts\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n# {\n# field(arg: "value") {\n# subField\n# }\n# }\n#\n# Keyboard shortcuts:\n#\n# Run Query: Ctrl-Enter (or press the play button above)\n#\n# Auto Complete: Ctrl-Space (or just start typing)\n#\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n# Default endpoint is an instance of https://www.graph.cool/\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n\nquery {\n countries {\n name\n }\n}\n';
+25
View File
@@ -0,0 +1,25 @@
<?php namespace GermanAirlinesVa\Graphql\Classes;
use Closure;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
class Authentication
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($request->header('Gql-Session') === 'SUPER_SECRET_KEY_HEADER') {
return '';
} else {
throw new AccessDeniedHttpException();
}
return $next($request);
}
}
+74
View File
@@ -0,0 +1,74 @@
<?php namespace GermanAirlinesVa\Graphql\Classes;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use GraphQL\Type\Definition\ResolveInfo;
use Nuwave\Lighthouse\Subscriptions\Subscriber;
use Nuwave\Lighthouse\Schema\Types\GraphQLSubscription;
use Nuwave\Lighthouse\Support\Contracts\GraphQLContext;
class Dummy extends GraphQLSubscription
{
/**
* Check if subscriber is allowed to listen to the subscription.
*
* @param \Nuwave\Lighthouse\Subscriptions\Subscriber $subscriber
* @param \Illuminate\Http\Request $request
* @return bool
*/
public function authorize(Subscriber $subscriber, Request $request): bool
{
return true;
}
/**
* Filter which subscribers should receive the subscription.
*
* @param \Nuwave\Lighthouse\Subscriptions\Subscriber $subscriber
* @param mixed $root
* @return bool
*/
public function filter(Subscriber $subscriber, $root): bool
{
return true;
}
/**
* Encode topic name.
*
* @param \Nuwave\Lighthouse\Subscriptions\Subscriber $subscriber
* @param string $fieldName
* @return string
*/
public function encodeTopic(Subscriber $subscriber, string $fieldName): string
{
// Create a unique topic name based on the `author` argument
return Str::snake($fieldName);
}
/**
* Decode topic name.
*
* @param string $fieldName
* @param \App\Post $root
* @return string
*/
public function decodeTopic(string $fieldName, $root): string
{
return Str::snake($fieldName);
}
/**
* Resolve the subscription.
*
* @param \App\Post $root
* @param array<string, mixed> $args
* @param \Nuwave\Lighthouse\Support\Contracts\GraphQLContext $context
* @param \GraphQL\Type\Definition\ResolveInfo $resolveInfo
* @return mixed
*/
public function resolve($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo): array
{
return [$root];
}
}
+6 -2
View File
@@ -68,7 +68,7 @@ class SchemaSourceProvider implements LighthouseSchemaSourceProvider
public function getSchemaString(): string public function getSchemaString(): string
{ {
// root types // root types
$schema = ' $schema = "
type Query { type Query {
dummy: Boolean dummy: Boolean
} }
@@ -76,7 +76,11 @@ class SchemaSourceProvider implements LighthouseSchemaSourceProvider
type Mutation { type Mutation {
dummy: Boolean dummy: Boolean
} }
';
type Subscription {
dummy: Boolean @subscription(class: \"GermanAirlinesVa\\\\Graphql\\\\Classes\\\\Dummy\")
}
";
// schema // schema
$schema .= collect($this->getGraphMap())->implode('schema', ''); $schema .= collect($this->getGraphMap())->implode('schema', '');
return $schema; return $schema;
+21
View File
@@ -4,6 +4,27 @@ use Cms\Classes\Theme;
use GermanAirlinesVa\Graphql\Models\Settings; use GermanAirlinesVa\Graphql\Models\Settings;
return [ return [
'connection' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => 'germanairlinesva_graphql',
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => 'InnoDB',
'options' => extension_loaded('pdo_mysql')
? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
])
: [],
],
'packages' => [ 'packages' => [
'nuwave/lighthouse' => [ 'nuwave/lighthouse' => [
'config_namespace' => 'lighthouse', 'config_namespace' => 'lighthouse',
+17
View File
@@ -0,0 +1,17 @@
<?php namespace GermanAirlinesVa\Graphql\Controllers;
use Backend\Classes\Controller;
class GraphqlKey extends Controller
{
public $implement = ['Backend\Behaviors\ListController'];
public $listConfig = 'config_list.yaml';
public $requiredPermissions = ['germanairlinesva.graphql.master'];
public function __construct()
{
parent::__construct();
}
}
+2 -3
View File
@@ -1,17 +1,16 @@
<?php namespace GermanAirlinesVa\Graphql\Controllers; <?php namespace GermanAirlinesVa\Graphql\Controllers;
use Backend\Classes\Controller; use Backend\Classes\Controller;
use BackendMenu;
class Playground extends Controller class Playground extends Controller
{ {
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
BackendMenu::setContext('GermanAirlinesVa.Graphql', 'menu', 'playground');
} }
public $requiredPermissions = ['germanairlinesva.graphql.master'];
public function index() public function index()
{ {
$this->pageTitle = 'germanairlinesva.graphql::lang.menu.playground'; $this->pageTitle = 'germanairlinesva.graphql::lang.menu.playground';
+18
View File
@@ -0,0 +1,18 @@
<div data-control="toolbar">
<button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
checked: $('.control-list').listWidget('getChecked')
})"
data-request="onDelete"
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator
>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>
+11
View File
@@ -0,0 +1,11 @@
list: $/germanairlinesva/graphql/models/graphqlkey/columns.yaml
modelClass: GermanAirlinesVa\Graphql\Models\GraphqlKey
title: GraphQL Keys
noRecordsMessage: 'backend::lang.list.no_records'
showSetup: true
showCheckboxes: true
recordsPerPage: 20
toolbar:
buttons: list_toolbar
search:
prompt: 'backend::lang.list.search_prompt'
+1
View File
@@ -0,0 +1 @@
<?= $this->listRender() ?>
+11 -3
View File
@@ -1,4 +1,3 @@
title = "CMS"
== ==
<?php <?php
use Cms\Classes\Theme; use Cms\Classes\Theme;
@@ -14,8 +13,17 @@ function resolveCmsContent($root, $args) {
?> ?>
== ==
# Content # Content
extend type Query { cmsContent(name: String!): CmsContent! } extend type Query {
type CmsContent { fileName: String! content: String markup: String parsedMarkup: String } cmsContent(name: String!): CmsContent!
}
type CmsContent {
fileName: String!
content: String
markup: String
parsedMarkup: String
}
# CMS-wide types # CMS-wide types
# Backend\Models\User # Backend\Models\User
type BackendUser { id: ID! } type BackendUser { id: ID! }
+18 -6
View File
@@ -1,4 +1,3 @@
title = "Fleet"
== ==
== ==
# Content # Content
@@ -6,10 +5,23 @@ extend type Query {
aircraft: [Aircraft] @all(model: "GermanAirlinesVa\\Fleet\\Models\\Aircraft") aircraft: [Aircraft] @all(model: "GermanAirlinesVa\\Fleet\\Models\\Aircraft")
aircraftType: [AircraftType] @all(model: "GermanAirlinesVa\\Fleet\\Models\\AircraftType") aircraftType: [AircraftType] @all(model: "GermanAirlinesVa\\Fleet\\Models\\AircraftType")
} }
extend type Subscription {
type Subscription { aircraftAdded: Aircraft @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\AircraftAdded")
aircraft: [Aircraft] @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\Aircraft") }
extend type Mutation {
addAircraft(aircraft_type_id: ID!, home_airport_id: ID!, name: String!, registration: String! ): Aircraft
@create(model:"GermanAirlinesVa\\Fleet\\Models\\Aircraft")
@broadcast(subscription: "aircraftAdded")
} }
type Aircraft { name: String! registration: String! } type Aircraft {
type AircraftType { type: String! aircrafts: [Aircraft] @hasMany } id: ID!
aircraft_type_id: ID!
home_airport_id: ID!
name: String!
registration: String!
}
type AircraftType {
type: String!
aircrafts: [Aircraft] @hasMany
}
+150
View File
@@ -0,0 +1,150 @@
==
<?php
function resolveExamMemberRanks($root, $args) {
$exams = \GermanAirlinesVa\Schooling\Models\ExamMemberRank::where('member_id', $args['memberID'])->get();
foreach($exams as $exam) {
$exam->load([
'exam_questions' => function ($query) {
$query->groupBy('id');
}
]);
}
return $exams;
}
function resolveExamTyperatings($root, $args) {
$exams = \GermanAirlinesVa\Schooling\Models\ExamTyperating::where('member_id', $args['memberID'])->get();
foreach($exams as $exam) {
$exam->load([
'exam_questions' => function ($query) {
$query->groupBy('id');
}
]);
}
return $exams;
}
function resolveTyperatings() {
$typeratings = GermanAirlinesVa\Schooling\Models\Typerating::all();
foreach($typeratings as $typerating) {
$typerating->load([
'exam_questions' => function($query) {
$query->groupBy('id');
}
]);
}
return $typeratings;
}
function resolveMemberRanks() {
$ranks = GermanAirlinesVa\Schooling\Models\MemberRank::all();
foreach($ranks as $rank) {
$rank->load([
'exam_questions' => function($query) {
$query->groupBy('id');
}
]);
}
return $rank;
}
function createExamMemberRank($root, $args) {
return GermanAirlinesVa\Schooling\Models\ExamMemberRank::createNew($args['memberID'], $args['memberRankID']);
}
function resolveCreateExamTyperating($root, $args) {
return GermanAirlinesVa\Schooling\Models\ExamTyperating::createNew($args['memberID'], $args['typeratingID']);
}
==
# Content
extend type Query {
memberRanks: [MemberRank]!
typeratings: [Typerating]!
examMemberRanks(memberID: ID!): [ExamMemberRank]!
examTyperatings(memberID: ID!): [ExamTyperating]!
}
extend type Mutation {
createExamMemberRank(memberID: ID!, memberRankID: ID!): ExamMemberRank!
createExamTyperating(memberID: ID!, typeratingID: ID!): ExamTyperating!
}
type MemberRank {
id: ID!
name: String!
description: String!
points: Int!
price: Int!
badge: String!
region: String!
exam_questions: [ExamMemberRankQuestion]! @hasMany
exams: [ExamMemberRank]! @hasMany
}
type Typerating {
id: ID!
name: String!
price: Int!
exam_questions: [ExamTyperatingQuestion]! @hasMany
exams: [ExamTyperating]! @hasMany
}
type ExamMemberRank {
id: ID!
member_id: ID!
member_rank: MemberRank! @belongsTo
start: DateTime!
status: ExamStatus!
exam_questions: [ExamMemberRankQuestion]! @belongsToMany
exam_answers: [ExamMemberRankAnswer]! @belongsToMany
}
type ExamTyperating {
id: ID!
member_id: ID!
typerating: Typerating! @belongsTo
start: DateTime!
status: ExamStatus!
exam_questions: [ExamTyperatingQuestion]! @belongsToMany
exam_answers: [ExamTyperatingAnswer]! @belongsToMany
}
type ExamMemberRankQuestion {
id: ID!
member_rank: MemberRank! @belongsTo
in_use: Boolean!
mandatory: Boolean!
text: String!
picture: String!
exam_answers: [ExamMemberRankAnswer]! @hasMany
exam_member_ranks: [ExamMemberRank]! @belongsToMany
}
type ExamTyperatingQuestion {
id: ID!
typerating: Typerating! @belongsTo
in_use: Boolean!
mandatory: Boolean!
text: String!
picture: String!
exam_answers: [ExamTyperatingAnswer]! @hasMany
exma_typeratings: [ExamTyperating]! @belongsToMany
}
type ExamMemberRankAnswer {
id: ID!
exam_question: ExamMemberRankQuestion! @belongsTo
text: String!
is_correct: Boolean!
exam_member_ranks: [ExamMemberRank]! @belongsToMany
}
type ExamTyperatingAnswer {
id: ID!
exam_question: ExamTyperatingQuestion! @belongsTo
text: String!
is_correct: Boolean!
exam_typeratings: [ExamTyperating]! @belongsToMany
}
enum ExamStatus {
open
pending
closed
validated
}
scalar DateTime
@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime")
+3 -1
View File
@@ -4,7 +4,9 @@
'description' => '', 'description' => '',
], ],
'menu' => [ 'menu' => [
'playground' => 'GA GraphiQL', 'main' => 'GA GraphQL',
'keys' => 'GraphQL Keys',
'playground' => 'GraphiQL',
], ],
'permission' => [ 'permission' => [
'tab' => [ 'tab' => [
+32
View File
@@ -0,0 +1,32 @@
<?php namespace GermanAirlinesVa\Graphql\Models;
use Model;
class GraphqlKey extends Model
{
use \October\Rain\Database\Traits\Validation;
/*
* Disable timestamps by default.
* Remove this line if timestamps are defined in the database table.
*/
public $timestamps = false;
/**
* @var string The database table used by the model.
*/
public $table = 'graphql_keys';
protected $connection = 'germanairlinesva_graphql';
/**
* @var array Validation rules
*/
public $rules = [
'member_id' => 'required',
'key' => 'required',
];
public $belongsTo = [
'member' => 'GermanAirlinesVa\Social\Models\Member',
];
}
-1
View File
@@ -1,6 +1,5 @@
<?php namespace GermanAirlinesVa\Graphql\Models; <?php namespace GermanAirlinesVa\Graphql\Models;
use Cms\Classes\Theme;
use Model; use Model;
class Settings extends Model class Settings extends Model
+15
View File
@@ -0,0 +1,15 @@
columns:
id:
label: id
type: number
member:
label: member
type: text
relation: member
valueFrom: name
valid_from:
label: valid_from
type: datetime
key:
label: key
type: text
+4 -3
View File
@@ -6,10 +6,11 @@
"author": "German Airlines VA", "author": "German Airlines VA",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@prettier/plugin-php": "^0.16.3", "@prettier/plugin-php": "^0.17.3",
"prettier": "^2.3.0" "prettier": "^2.3.2"
}, },
"scripts": { "scripts": {
"format": "prettier --write './**/*.{php,html,htm,yaml}'" "preinstall": "git config core.hooksPath .hooks",
"format": "prettier --write './**/*.{php,html,yaml}'"
} }
} }
+12 -3
View File
@@ -5,13 +5,22 @@ plugin:
icon: oc-icon-database icon: oc-icon-database
homepage: '' homepage: ''
permissions: permissions:
schemas: germanairlinesva.graphql.master:
tab: 'germanairlinesva.graphql::lang.permission.tab.schemas' tab: 'germanairlinesva.graphql::lang.permission.tab.schemas'
label: 'germanairlinesva.graphql::lang.permission.label.schemas' label: 'germanairlinesva.graphql::lang.permission.label.schemas'
navigation: navigation:
menu: menu:
label: 'germanairlinesva.graphql::lang.menu.main'
url: /
icon: icon-database
permissions:
- germanairlinesva.graphql.master
sideMenu:
side-menu-item:
label: 'germanairlinesva.graphql::lang.menu.playground' label: 'germanairlinesva.graphql::lang.menu.playground'
url: germanairlinesva/graphql/playground url: germanairlinesva/graphql/playground
icon: icon-database icon: icon-database
permissions: side-menu-item2:
- schemas label: 'germanairlinesva.graphql::lang.menu.keys'
url: germanairlinesva/graphql/graphqlkey
icon: icon-key
@@ -0,0 +1,30 @@
<?php namespace GermanAirlinesVa\GraphQl\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateGermanAirlinesVaGraphQlDeferredBindings extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_graphql')->create('deferred_bindings', function ($table) {
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->string('master_type');
$table->string('master_field');
$table->string('slave_type');
$table->integer('slave_id');
$table->mediumText('pivot_data')->nullable();
$table->string('session_key');
$table->boolean('is_bind')->default(true);
$table->timestamps();
});
}
public function down()
{
Schema::connection('germanairlinesva_graphql')->disableForeignKeyConstraints();
Schema::connection('germanairlinesva_graphql')->dropIfExists('deferred_bindings');
Schema::connection('germanairlinesva_graphql')->enableForeignKeyConstraints();
}
}
@@ -0,0 +1,26 @@
<?php namespace GermanAirlinesVa\Graphql\Updates;
use DB;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateGermanAirlinesVaGraphqlGraphqlKeys extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_graphql')->create('graphql_keys', function ($table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('member_id')->unsigned();
$table->datetime('valid_from')->default(DB::raw('NOW()'));
$table->string('key');
});
}
public function down()
{
Schema::connection('germanairlinesva_graphql')->disableForeignKeyConstraints();
Schema::connection('germanairlinesva_graphql')->dropIfExists('graphql_keys');
Schema::connection('germanairlinesva_graphql')->enableForeignKeyConstraints();
}
}
+6 -1
View File
@@ -1,2 +1,7 @@
1.0.1: 1.0.1:
- Initialize plugin. - 'Initialize plugin.'
- 'Create table deferred_bindings'
- builder_table_create_deferred_bindings.php
1.0.2:
- 'Create table graphql_keys'
- builder_table_create_graphql_keys.php
+11 -12
View File
@@ -2,14 +2,14 @@
# yarn lockfile v1 # yarn lockfile v1
"@prettier/plugin-php@^0.16.3": "@prettier/plugin-php@^0.17.3":
version "0.16.3" version "0.17.3"
resolved "https://registry.yarnpkg.com/@prettier/plugin-php/-/plugin-php-0.16.3.tgz#74867210079ba3c0c3ae843029d76e25ff0aadf3" resolved "https://registry.yarnpkg.com/@prettier/plugin-php/-/plugin-php-0.17.3.tgz#193a18e308db7416f26f6e1dc0d2605d1ff01416"
integrity sha512-DNidzeGpP+/wmcCAZNSHxgoAnhEosYG+no4jJRqln19e1o3Okpuir/2JMxb07VCwdG50IWjtNgVwNPVl4uj0Hg== integrity sha512-kD5IrGyKWF/p3XActVZ+GfbMl9knoK3XKBTG2bytpOtCO0+Q8eozimSgk/493rgFkXL3W2Ap/4GKgZf7u64+ow==
dependencies: dependencies:
linguist-languages "^7.5.1" linguist-languages "^7.5.1"
mem "^8.0.0" mem "^8.0.0"
php-parser "3.0.2" php-parser "https://github.com/glayzzle/php-parser#e61e26102144f267ecf5e09020865a9baa6ca2f1"
linguist-languages@^7.5.1: linguist-languages@^7.5.1:
version "7.15.0" version "7.15.0"
@@ -41,12 +41,11 @@ p-defer@^1.0.0:
resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c"
integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=
php-parser@3.0.2: "php-parser@https://github.com/glayzzle/php-parser#e61e26102144f267ecf5e09020865a9baa6ca2f1":
version "3.0.2" version "3.0.2"
resolved "https://registry.yarnpkg.com/php-parser/-/php-parser-3.0.2.tgz#a86dbbc110e57378cba71ab4cd9b0d18f3872ac3" resolved "https://github.com/glayzzle/php-parser#e61e26102144f267ecf5e09020865a9baa6ca2f1"
integrity sha512-a7y1+odEGsceLDLpu7oNyspZ0pK8FMWJOoim4/yd82AtnEZNLdCLZ67arnOQZ9K0lHJiSp4/7lVUpGELVxE14w==
prettier@^2.3.0: prettier@^2.3.2:
version "2.3.0" version "2.3.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d"
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w== integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==