ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 12632


Ignore:
Timestamp:
Aug 13, 2009, 5:40:55 PM (13 years ago)
Author:
ebihara
Message:

#3943:changed some table definitions for member level oauth consumer and oauth tokens

Location:
OpenPNE3/trunk
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/config/doctrine/schema.yml

    r12568 r12632  
    357357    file_id: { type: integer(4), comment: "Image file id of this consumer" }
    358358    using_apis: { type: array, comment: "API list that this consumer uses" }
    359   relations:
     359    member_id: { type: integer(4), notnull: false, comment: "Member id" }
     360  relations:
     361    Member: { local: member_id, foreign: id, onDelete: cascade }
    360362    Image: { class: File, local: file_id, foreign: id, onDelete: set null }
    361363  indexes:
     
    369371    comment: "Saves informations of OAuth Consumer"
    370372
    371 OAuthAdminToken:
     373OAuthAbstractToken:
     374  abstract: true
    372375  columns:
    373376    id: { type: integer(4), primary: true, autoincrement: true, comment: "Serial number" }
     
    379382    callback_url: { type: string, comment: "Callback url" }
    380383    verifier: { type: string, comment: "Token verifier" }
    381   relations:
    382     Consumer: { class: OAuthConsumerInformation, local: oauth_consumer_id, foreign: id, onDelete: cascade }
    383384  indexes:
    384385    key_secret_UNIQUE:
    385386      fields: [key_string, secret]
    386387      type: unique
     388
     389OAuthAdminToken:
     390  inheritance:
     391    extends: OAuthAbstractToken
     392    type: concrete
     393  relations:
     394    Consumer: { class: OAuthConsumerInformation, local: oauth_consumer_id, foreign: id, onDelete: cascade }
    387395  options:
    388396    type: INNODB
     
    390398    charset: utf8
    391399    comment: "Saves administration tokens of OAuth"
     400
     401OAuthMemberToken:
     402  inheritance:
     403    extends: OAuthAbstractToken
     404    type: concrete
     405  columns:
     406    member_id: { type: integer(4), notnull: true, comment: "Member id" }
     407  relations:
     408    Consumer: { class: OAuthConsumerInformation, local: oauth_consumer_id, foreign: id, onDelete: cascade }
     409    Member: { local: member_id, foreign: id, onDelete: cascade }
     410  options:
     411    type: INNODB
     412    collate: utf8_unicode_ci
     413    charset: utf8
     414    comment: "Saves memebr tokens of OAuth"
    392415
    393416Banner:
  • OpenPNE3/trunk/data/migrations/3.1.2/016_add_oauth_column.php

    r12568 r12632  
    1 
    2 
    31<?php
    42
  • OpenPNE3/trunk/lib/migration/opMigrationDiff.class.php

    r12366 r12632  
    2323    foreach ($models as $key => $model)
    2424    {
     25      $classRef = new ReflectionClass($model);
     26      if ($classRef->isAbstract())
     27      {
     28        continue;
     29      }
     30
    2531      $table = Doctrine::getTable($model);
    2632      if ($table->getTableName() !== $this->_migration->getTableName())
    2733      {
    2834        $info[$model] = $table->getExportableFormat();
    29 
    3035        foreach ($table->getTemplates() as $name => $template)
    3136        {
  • OpenPNE3/trunk/lib/task/openpneGenerateMigrationsTask.class.php

    r12366 r12632  
    5757      }
    5858
     59      $normalModelName = str_replace('Base', '', basename($model, '.class.php'));
     60      $normalModelRefClass = new ReflectionClass($normalModelName);
     61      if ($normalModelRefClass && $normalModelRefClass->isAbstract())
     62      {
     63        continue;
     64      }
     65
    5966      $content = file_get_contents($model);
    6067      $content = str_replace('abstract class Base', 'class ToPrfx', $content);
Note: See TracChangeset for help on using the changeset viewer.