• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python yoyo.step函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中yoyo.step函数的典型用法代码示例。如果您正苦于以下问题:Python step函数的具体用法?Python step怎么用?Python step使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了step函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: step

"""
After applying all migrations create views.
"""

from yoyo import step
step(
    "CREATE VIEW `apiary_website_logs_summary` AS \
        SELECT `apiary_website_logs`.`website_id` AS `website_id`, \
            count(0) AS `log_count`, \
            max(`apiary_website_logs`.`log_date`) AS `log_date_last`, \
            min(`apiary_website_logs`.`log_date`) AS `lot_date_first` \
            FROM `apiary_website_logs` \
            GROUP BY `apiary_website_logs`.`website_id`;",
    "DROP VIEW IF EXISTS `apiary_website_logs_summary`;"
)
开发者ID:WikiApiary,项目名称:WikiApiary,代码行数:15,代码来源:post-apply.py


示例2: step

from yoyo import step

step("""
CREATE TABLE movements (
  id     SERIAL,
  token  VARCHAR,
  amount BIGINT
);
    """,
    """DROP TABLE movements;""")
开发者ID:NinjaDevelper,项目名称:accounts,代码行数:10,代码来源:0004-create-movements.py


示例3: step

"""
Add not-null col in Ad
"""

from yoyo import step

__depends__ = {'20151208_02_dPGPe-rename-currencys-col-in-ad'}

steps = [
    step("ALTER TABLE ad CHANGE COLUMN site site VARCHAR(30) NOT NULL"),
    step("DELETE FROM ad WHERE site_id is NULL"),
    step("ALTER TABLE ad CHANGE COLUMN site_id site_id VARCHAR(100) NOT NULL"),
    step("ALTER TABLE ad CHANGE COLUMN country country VARCHAR(2) NOT NULL"),
]
开发者ID:jplusplus,项目名称:rentswatch-scraper,代码行数:14,代码来源:20151217_01_mGj93-add-not-null-col-in-ad.py


示例4: step

"""
Store the raw statistics collected from SMW.

This migration implements part of the manually created Apiary DB
that WikiApiary launched with.
"""

from yoyo import step
step(
    "CREATE TABLE `smwinfo` ( \
        `website_id` int(11) NOT NULL, \
        `capture_date` datetime NOT NULL, \
        `response_timer` float DEFAULT NULL, \
        `propcount` bigint(20) NOT NULL, \
        `proppagecount` int(11) NOT NULL, \
        `usedpropcount` int(11) NOT NULL, \
        `declaredpropcount` int(11) NOT NULL, \
        `querycount` int(11) DEFAULT NULL, \
        `querysize` int(11) DEFAULT NULL, \
        `conceptcount` int(11) DEFAULT NULL, \
        `subobjectcount` int(11) DEFAULT NULL, \
        PRIMARY KEY (`website_id`,`capture_date`) \
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
    "DROP TABLE `smwinfo`",
    ignore_errors='rollback', # This table is dropped in migration 20.
)
开发者ID:WikiApiary,项目名称:WikiApiary,代码行数:26,代码来源:0006.create-smwinfo.py


示例5: transaction

from yoyo import step, transaction

transaction(
    step("""CREATE TABLE summits_images (
        image varchar(64) PRIMARY KEY,
        preview varchar(64) NOT NULL,
        summit_id integer REFERENCES summits(id),
        main boolean DEFAULT false,
        comment text DEFAULT NULL
        )""")
)
开发者ID:binrush,项目名称:thousands,代码行数:11,代码来源:007.summits_images.py


示例6: step

from yoyo import step

step(
    """
    ALTER TABLE User ADD COLUMN registerDate timestamp not null default current_timestamp
    """,

    "ALTER TABLE User DROP COLUMN registerDate",
)
开发者ID:zachwick,项目名称:hwpc,代码行数:9,代码来源:2016_02_14_000_add_registerdate_to_user.py


示例7: step

from yoyo import step

step(
    "CREATE TABLE IF NOT EXISTS softban_log (status text, source text, dated datetime DEFAULT CURRENT_TIMESTAMP)"
)
开发者ID:Gurzeh,项目名称:PokemonGo-Bot,代码行数:5,代码来源:softban_log.py


示例8: transaction

from yoyo import step, transaction

# Removing dummy images downloaded from vk.com as user pictures
# due to bug in vk_get_user and replacing them with NULL to user
# our dummy images instead;

transaction(
    step("UPDATE users SET image=NULL, preview=NULL " +
         "WHERE image='29a62e8bc3609aef88ac2bc722bf7c71f4f86a32.png'"),
    step("DELETE FROM images WHERE " +
         "name='29a62e8bc3609aef88ac2bc722bf7c71f4f86a32.png'"),
    step("DELETE FROM images WHERE " +
         "name='1fc78e0df8d470a82ed55882ac619e7aafa68051.png'")
)
开发者ID:binrush,项目名称:thousands,代码行数:14,代码来源:006.vk_dummy_photos.py


示例9: step

"""Create media migration"""
# pylint: disable=C0103

#
# file: migrations/0002.create-media.py
#
from yoyo import step

step(
    """
    CREATE TABLE media
    (
        id serial,
        media_id text NOT NULL,
        media_created_time timestamp NOT NULL,
        data json NOT NULL,
        created_at timestamp with time zone NOT NULL,
        updated_at timestamp with time zone,
        CONSTRAINT pk_media PRIMARY KEY (id),
        CONSTRAINT uq_media_id UNIQUE (media_id)
    )
    """,
    "DROP TABLE IF EXISTS media CASCADE;",
)
开发者ID:Smotko,项目名称:hipster-frame,代码行数:24,代码来源:0002.create-media.py


示例10: step

"""
Add description to Ad
"""

from yoyo import step

__depends__ = {'20151217_01_mGj93-add-not-null-col-in-ad'}

steps = [
    step("ALTER TABLE ad ADD description TEXT"),
]
开发者ID:jplusplus,项目名称:rentswatch-scraper,代码行数:11,代码来源:20160324_01_30zI3-add-description-to-ad.py


示例11: step

from yoyo import step

step("""
UPDATE nodes
SET is_input=1
WHERE rowid
IN (SELECT input FROM nodes_to_nodes)
""")
step("""
UPDATE nodes
SET is_response=1
WHERE rowid
IN (SELECT response FROM nodes_to_nodes)
""")

''' #this doesn't work in sqlite
step("""UPDATE nodes n 
JOIN nodes_to_nodes n2n 
  ON n.rowid=n2n.response
SET n.is_response=1""",
     "UPDATE nodes SET is_response=0")
step("""UPDATE nodes n 
JOIN nodes_to_nodes n2n 
  ON n.rowid=n2n.input
SET n.is_input=1""",
     "UPDATE nodes SET is_input=0")
'''
开发者ID:serversquared,项目名称:VirtualMimic,代码行数:27,代码来源:0003-populate-is-fields.py


示例12: step

that WikiApiary launched with.
"""

from yoyo import step
step(
    "CREATE TABLE `statistics_daily` ( \
        `website_id` int(11) NOT NULL, \
        `website_date` date NOT NULL, \
        `users_min` bigint(20) NOT NULL, \
        `users_max` bigint(20) NOT NULL, \
        `activeusers_max` bigint(20) NOT NULL, \
        `admins_max` bigint(20) NOT NULL, \
        `articles_min` bigint(20) NOT NULL, \
        `articles_max` bigint(20) NOT NULL, \
        `edits_min` bigint(20) NOT NULL, \
        `edits_max` bigint(20) NOT NULL, \
        `jobs_max` bigint(20) NOT NULL, \
        `pages_min` bigint(20) NOT NULL, \
        `pages_max` bigint(20) NOT NULL, \
        `pages_last` bigint(20) NOT NULL, \
        `views_min` bigint(20) NOT NULL, \
        `views_max` bigint(20) NOT NULL, \
        `smw_propcount_min` bigint(20) NOT NULL, \
        `smw_propcount_max` bigint(20) NOT NULL, \
        `smw_proppagecount_last` int(11) NOT NULL, \
        `smw_usedpropcount_last` int(11) NOT NULL, \
        `smw_declaredpropcount_last` int(11) NOT NULL, \
        PRIMARY KEY (`website_id`,`website_date`) \
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
    "DROP TABLE `statistics_daily`",
)
开发者ID:WikiApiary,项目名称:WikiApiary,代码行数:31,代码来源:0008.create-statistics-daily.py


示例13: step

from yoyo import step

step(
    '''CREATE TABLE IF NOT EXISTS loc (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        name VARCHAR(50) UNIQUE NOT NULL,
        map UNIQUE NOT NULL,
        phone INTEGER UNIQUE NOT NULL,
        fax INTEGER UNIQUE NOT NULL,
        address TEXT UNIQUE NOT NULL,
        city TEXT UNIQUE NOT NULL,
        zipcode INTEGER UNIQUE NOT NUll,
        state TEXT UNIQUE NOT NULL,
        email TEXT UNIQUE NOT NULL)''',
    '''DROP TABLE IF EXISTS loc''',
)
开发者ID:cdaug,项目名称:AbelsonMechanical,代码行数:16,代码来源:20160113111355-create-loc.py


示例14: step

"""
Logging table to keep log entries for related to a specific
website.

This migration implements part of the manually created Apiary DB
that WikiApiary launched with.
"""

from yoyo import step
step(
    "CREATE TABLE `apiary_website_logs` ( \
        `log_id` int(11) NOT NULL AUTO_INCREMENT, \
        `website_id` int(11) NOT NULL, \
        `log_date` datetime NOT NULL, \
        `website_name` varchar(255) NOT NULL, \
        `log_type` varchar(30) NOT NULL, \
        `log_severity` varchar(30) NOT NULL, \
        `log_message` varchar(255) NOT NULL, \
        `log_bot` varchar(30) DEFAULT NULL, \
        `log_url` varchar(255) DEFAULT NULL, \
        PRIMARY KEY (`log_id`), \
        KEY `idx_log_date` (`log_date`) USING BTREE, \
        KEY `idx_website_id_log_date` (`website_id`,`log_date`) USING BTREE \
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
    "DROP TABLE `apiary_website_logs`",
)
开发者ID:WikiApiary,项目名称:WikiApiary,代码行数:26,代码来源:0002.create-apiary-website-logs.py


示例15: step

from yoyo import step

step("""
CREATE TABLE prices (
  id     SERIAL,
  bytes  BIGINT,
  amount BIGINT
);
    """,
    """DROP TABLE prices;""")
开发者ID:NinjaDevelper,项目名称:accounts,代码行数:10,代码来源:0005-create-prices.py


示例16: step

"""
Added moveIn to Rent model
"""

from yoyo import step

__depends__ = {'20160408_01_OgXf5-added-rent-model'}

steps = [
    step("ALTER TABLE rent ADD move_in DATE"),
]
开发者ID:jplusplus,项目名称:rentswatch-scraper,代码行数:11,代码来源:20160408_02_wg1lz-added-movein-to-rent-model.py


示例17: create_tables

from yoyo import step


def create_tables(conn):
    c = conn.cursor()
    c.executescript("""
        CREATE TABLE log (
            timestamp INTEGER,
            source TEXT,
            text TEXT
        );
    """)

step(create_tables)
开发者ID:carriercomm,项目名称:mudsling,代码行数:14,代码来源:0001-channel_log.py


示例18: images

);

CREATE TABLE IF NOT EXISTS images (
    id serial PRIMARY KEY,
    type varchar(256),
    payload bytea
);

CREATE TABLE IF NOT EXISTS users (
    id serial PRIMARY KEY,
    oauth_id varchar(256) NOT NULL,
    src smallint NOT NULL,
    name varchar(256) NOT NULL,
    email varchar(256),
    img_id int REFERENCES images DEFAULT NULL,
    pub boolean NOT NULL DEFAULT true,
    admin boolean NOT NULL DEFAULT false,
    UNIQUE (oauth_id, src)
);

CREATE TABLE IF NOT EXISTS climbs (
    user_id integer NOT NULL REFERENCES users,
    summit_id integer NOT NULL REFERENCES summits,
    ts date,
    comment text,
    PRIMARY KEY (user_id, summit_id)
);
"""

step(sql)
开发者ID:antonvorobyev,项目名称:thousands,代码行数:30,代码来源:000.baseline.py


示例19: step

"""
Added ipHash and createdAt to Rent model
"""

from yoyo import step

__depends__ = {'20160408_02_wg1lz-added-movein-to-rent-model'}

steps = [
    step("ALTER TABLE rent ADD created_at TIMESTAMP NOT NULL DEFAULT now()"),
    step("ALTER TABLE rent ADD ip_hash VARCHAR(512) NOT NULL DEFAULT ''"),
]
开发者ID:jplusplus,项目名称:rentswatch-scraper,代码行数:12,代码来源:20160411_01_ylLTx-added-iphash-and-createdat-to-rent-model.py


示例20: step

"""
This table is used to store property values for websites that may
contain multiple results. For example, the database version number
used in a wiki farm may be different if there are multiple database
backends. Using multiprops we can store all of the various versions
used as well as the time periods involved.

This migration implements part of the manually created Apiary DB
that WikiApiary launched with.
"""

from yoyo import step
step(
    "CREATE TABLE `apiary_multiprops` ( \
        `website_id` int(11) NOT NULL, \
        `t_name` varchar(255) NOT NULL, \
        `t_value` varchar(255) NOT NULL, \
        `first_date` datetime NOT NULL, \
        `last_date` datetime NOT NULL, \
        `occurrences` int(11) NOT NULL, \
        PRIMARY KEY (`website_id`,`t_name`,`t_value`) \
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
    "DROP TABLE `apiary_multiprops`",
)
开发者ID:WikiApiary,项目名称:WikiApiary,代码行数:24,代码来源:0004.create-apiary-multiprops.py



注:本文中的yoyo.step函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ystockquote.get_all函数代码示例发布时间:2022-05-26
下一篇:
Python stacks.YowStack类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap