Skip to content

Instantly share code, notes, and snippets.

Bennie Kahler-Venter bkahlerventer

View GitHub Profile
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
class InitialDbMigrationCommand extends CConsoleCommand
public function run($args) {
$schema = $args[0];
$tables = Yii::app()->db->schema->getTables($schema);
$addForeignKeys = '';
$dropForeignKeys = '';
bkahlerventer /
Created Nov 2, 2015 — forked from techniq/
SQLAlchemy View support
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.