Skip to content

Instantly share code, notes, and snippets.

Bennie Kahler-Venter bkahlerventer

Block or report user

Report or block bkahlerventer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bkahlerventer
bkahlerventer / InitialDbMigrationCommand.php
Last active May 3, 2016 — forked from bmarston/InitialDbMigrationCommand.php
Let's say you're starting a new Yii project and you've already created the database schema for it using something like phpMyAdmin or MySQL Workbench. Now you want to create an initial database migration so you can put the schema under version control, but you don't want to manually write the Yii code to create the tables, indexes, and foreign ke…
View InitialDbMigrationCommand.php
<?php
class InitialDbMigrationCommand extends CConsoleCommand
{
public function run($args) {
$schema = $args[0];
$tables = Yii::app()->db->schema->getTables($schema);
$addForeignKeys = '';
$dropForeignKeys = '';
@bkahlerventer
bkahlerventer / view.py
Created Nov 2, 2015 — forked from techniq/view.py
SQLAlchemy View support
View view.py
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql.expression import Executable, ClauseElement
from sqlalchemy.schema import DDLElement, DropTable
from sqlalchemy.sql import table
from sqlalchemy.orm import Query
from . import db
class CreateView(DDLElement):
View logstash-template.json
{
"template": "logstash-*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index" : {
"query" : { "default_field" : "@message" },
"store" : { "compress" : { "stored" : true, "tv": true } }
}
},
You can’t perform that action at this time.